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 244076 - Private methods that are marked with certain annotations (e.g. JPA's @PostLoad) aren't recognized as being used
Summary: Private methods that are marked with certain annotations (e.g. JPA's @PostLoa...
Status: RESOLVED DUPLICATE of bug 176240
Alias: None
Product: javaee
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-25 12:35 UTC by terje7601
Modified: 2014-07-03 06:45 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description terje7601 2014-04-25 12:35:41 UTC
In the class below, the method "doSomething" is marked as unused, but JPA will actually invoke the method.

This kind of methods isn't limited to JPA (& not even to Java EE), so this should be solved in a generic way (e.g. by being able to specify a list of annotations & by default having all known Java EE annotations in the list).

class User implements Serializable {

	@PostLoad
	private void doSomething() {}

}
Comment 1 Martin Fousek 2014-06-20 12:17:06 UTC
Dusane, please is there any Java API we can use to fix that?
Comment 2 Dusan Balek 2014-06-20 18:13:16 UTC
Unfortunately, there is no such support yet :-(
Comment 3 Martin Fousek 2014-07-03 06:45:56 UTC
Looks like the bug is duplicate. Of course once the API would be available there will be necessary to filter all life-cycle or similar methods. Feel free to reassign that then.

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