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 7494 - a bug in ClassElement.forName()
Summary: a bug in ClassElement.forName()
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 normal (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-08-25 14:51 UTC by Antanas Radzius
Modified: 2007-09-26 09:14 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 Antanas Radzius 2000-08-25 14:51:38 UTC
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".
Comment 1 Svata Dedic 2000-08-25 15:05:59 UTC
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.
Comment 2 Antanas Radzius 2000-08-25 16:03:59 UTC
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?
Comment 3 Svata Dedic 2000-09-04 09:15:59 UTC
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.
Comment 4 Jan Becicka 2000-10-11 08:56:59 UTC
[1120] Bug still lives
Comment 5 Jan Becicka 2000-11-01 15:31:59 UTC
[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.
Comment 6 Jan Becicka 2000-11-01 17:48:59 UTC
Sorry, previous line should be:
("org.openide.awt.Actions$SubMenuModel") works fine.
Comment 7 Svata Dedic 2000-11-03 16:05:59 UTC
[1038, dev-63] fixed.
Comment 8 Svata Dedic 2000-11-03 16:08:59 UTC
[1138, dev-63] fixed.
Comment 9 Jan Becicka 2000-11-10 08:51:59 UTC
[1148] Verified
Comment 10 Quality Engineering 2003-07-01 13:18:29 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.