This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 215004 - Redundant squiggly line under lifecycle callback methods
Summary: Redundant squiggly line under lifecycle callback methods
Status: RESOLVED DUPLICATE of bug 176240
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-29 20:51 UTC by arungupta
Modified: 2012-07-02 09:48 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arungupta 2012-06-29 20:51:04 UTC
For a POJO as:

@Path("movies")
public class MovieResource {
    
    List<Movie> movies;
    
    @PostConstruct
    private void init() {
        // ...
    }

There is a squiggly line under the method name "init" with the pop up saying "Method init() is not used.". This method is not meant to be invoked by the application class and instead is a lifecycle call back method.

The squiggly line should not be shown.
Comment 1 David Konecny 2012-07-01 22:03:04 UTC
Is it Java module itself which provides "Method {name} is not used." hint? Is there any way to prevent that hint from appearing in conditions described in this issue? Maybe hint should not be shown if a private method has some annotation as annotation indicates the method has some purpose?
Comment 2 Jan Lahoda 2012-07-02 09:48:25 UTC
The long term idea is to add an API that would allow code that supports such frameworks mark some methods as used. Marking each method that has an annotation as used would not work very well, IMO - consider e.g. @SuppressWarnings.

*** This bug has been marked as a duplicate of bug 176240 ***