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

Summary: ClassElement.forName does not always return the same reference
Product: java Reporter: Jan Becicka <jbecicka>
Component: UnsupportedAssignee: issues@java <issues>
Status: CLOSED WORKSFORME    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:

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.