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 206795 - @ActionRegistration accepted on a nonstatic inner class
Summary: @ActionRegistration accepted on a nonstatic inner class
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 7.2
Hardware: PC Linux
: P4 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-29 23:08 UTC by Jesse Glick
Modified: 2012-05-23 09:28 UTC (History)
0 users

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 Jesse Glick 2011-12-29 23:08:58 UTC
...resulting in e.g.

java.lang.NoSuchMethodException: Outer$MyAction.<init>()
	at java.lang.Class.getConstructor0(Class.java:2706)
	at java.lang.Class.getDeclaredConstructor(Class.java:1985)
[catch] at org.netbeans.core.startup.layers.BinaryFS$AttrImpl.getValue(BinaryFS.java:665)

at runtime. This kind of thing ought to be caught at compile time.

Compare bb589418e46f. A general clause in LayerBuilder.instantiableClassOrMethod would catch many usages, but not all.
Comment 1 Jaroslav Tulach 2012-05-21 11:50:32 UTC
ergonomics#b6b12944cf78
Comment 2 Jesse Glick 2012-05-21 16:37:42 UTC
BTW typo: "annoated"
Comment 3 Quality Engineering 2012-05-22 16:09:57 UTC
Integrated into 'main-golden', will be available in build *201205220903* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ae45c0b93120
User: Jesse Glick <jglick@netbeans.org>
Log: Forbid instantiating a nonstatic nested class.
Some special cases handled in bb589418e46f, and b6b12944cf78 (#206795).
Comment 4 Quality Engineering 2012-05-23 09:28:41 UTC
Integrated into 'main-golden', will be available in build *201205230300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b6b12944cf78
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #206795: @ActionRegistration accepted on a nonstatic inner class