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.
ClassElement.forName() doesn't find package private classes. And I have the following source: import org.openide.awt.Actions; public class MyClass { private Actions.SubMenuModel model; } ClassElement.forName() doesn't find class: "org.openide.awt.Actions.SubMenuModel".
The behaviour surely works in builds dev-20 and 1085 and later, with or without the openide.jar mounted in the IDE. In the latter case, the class is loaded into the VM and the ClassElement results from introspecting the class. Please include build number for proper testing/reproduction.
I tried this on build 842 and netbeans 3.0 stable(build 5) And which case works for you: 1) package private classes, 2) "org.openide.awt.Actions.SubMenuModel", or both?
The exact condition for this bug to occur is - you are trying to find a ClassElement for an inner class, and - the source for the class cannot be located, and - outerclass name(s) are separated by '.' instead of '$' Although ClassElement.forName() documentation explicitly states that both forms (OuterClass.InnerClass and OuterClass$InnerClass) should yield the same result, it was not true for sourceless classes as the JVM did not locate the Class object for OuterClass.InnerClass.
[1120] Bug still lives
[1135] org.openide.src.ClassElement.forName("org.openide.awt.Actions.SubMenuModel") returns null, but org.openide.src.ClassElement.forName ("org.openide.awt.Actions.SubMenuModel") works fine.
Sorry, previous line should be: ("org.openide.awt.Actions$SubMenuModel") works fine.
[1038, dev-63] fixed.
[1138, dev-63] fixed.
[1148] Verified
Resolved for 3.4.x or earlier, no new info since then -> closing.