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 16411 - ClassElement.forName does not always return the same reference
Summary: ClassElement.forName does not always return the same reference
Status: CLOSED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 10:36 UTC by Jan Becicka
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 Jan Becicka 2001-10-10 10:36:01 UTC
[200110100100]
ClassElement.forName does not return always the same reference.
This behavior is not deterministic :-(

Test case:

org.openide.src.ClassElement ce = org.openide.src.ClassElement.forName
("integrity.test.TopLevelClass$InnerClass");
        for (int i=0;i<LOOPCOUNT;i++){
            if (ce!=org.openide.src.ClassElement.forName
("integrity.test.TopLevelClass$InnerClass")){
                System.out.println("forName returned wrong reference!");
            }
            System.gc();
            Thread.currentThread().sleep(i*500);
        }
Comment 1 Jan Becicka 2001-10-10 10:40:40 UTC
ClassElement.forName() sometimes returns null. IMO it could be caused 
by some too lazy initialization.
Comment 2 Svata Dedic 2001-10-10 12:54:17 UTC
Does it "only" return null sometimes, or does it return something 
other valid ClassElement reference ?
Comment 3 Jan Becicka 2001-10-17 15:09:16 UTC
I cannot reproduce this bug in latest builds. Changing resolution to 
WORKSFORME.
Comment 4 Quality Engineering 2003-07-01 13:11:50 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 5 Quality Engineering 2003-07-01 13:18:03 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.