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 - problems with SourceElement.addClass() and SourceElement.getClass()
Summary: problems with SourceElement.addClass() and SourceElement.getClass()
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P2 major (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-06-23 15:51 UTC by Martin Ryzl
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 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.