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 6890

Summary: problems with SourceElement.addClass() and SourceElement.getClass()
Product: java Reporter: Martin Ryzl <mryzl>
Component: UnsupportedAssignee: Svata Dedic <sdedic>
Status: CLOSED FIXED    
Severity: major    
Priority: P2    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Martin Ryzl 2000-06-23 15:51:21 UTC
Try following code on test/Test.java:

... get source cookie ...
SourceElement se = cookie.getSource();
ClassElement ce = new ClassElement();
ce.setName(Identifier.create("test.Test", "Test"));
se.addClass(ce);
ce = se.getClass(Identifier.create("test.Test"));
System.err.println("ce = " + ce);
ClassElement[] ces = se.getClasses();
for(int i = 0; i < ces.length; i++) {
  System.err.println("ce[" + i + "] " + ces[i].getName() + ", full = " +
    ces[i].getName().getFullName());
}

I would expect following output:

ce = <textual representation of class>
ce[0] Test, full = test.Test

But I've got:

ce = null
ce[0] Test, full = Test
ce[1] Test, full = test.Test.Test
Comment 1 Quality Engineering 2003-07-01 13:20:36 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.