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.
(NB6.8beta) In a Java EE managed bean (EJB, JSF managed bean, plain managed bean, etc...), methods annotated with @PostConstruct (@PreDestroy) are always marked as not used, while in fact they always are when executed in a container.
*** Bug 203198 has been marked as a duplicate of this bug. ***
*** Bug 215004 has been marked as a duplicate of this bug. ***
*** Bug 176241 has been marked as a duplicate of this bug. ***
*** Bug 226104 has been marked as a duplicate of this bug. ***
*** Bug 244076 has been marked as a duplicate of this bug. ***
5 duplicates - I think this deserves some consideration.
*** Bug 244882 has been marked as a duplicate of this bug. ***
(In reply to Petr Jiricka from comment #6) > 5 duplicates - I think this deserves some consideration. I must agree. Number of complaining users is growing.
I can confirm this is really cumbersome. I like my error stripes clean, but some less experienced developers on the team might think these methods need some cleaning. This issue should be expanded, based on duplicates such as 176241, as to cover unused Java EE boilerplate, such as @Id as well. Also notice any persistent fields on entities which are assigned are useful since they can be queried.
Moving to java.source, marking as high prio ENHANCEMENT. There has to be a common API for specification-defined usage and / or names. E.g. * hints check naming and access rights, which might be defined by some technology (c.f. serialVersionUID) * editor highlights unused symbols, which can be marked by annotations or injected in some special subtypes (c.f. @Autowired) Not sure whether the API should allow to extend "usage" relationship to capture real usage of fields outside plain java access, i.e. Spring configuration for a property accesses setter etc.