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 6365

Summary: org.openide.src.ClassElement`s member manipulation methods do not preserve object identity.
Product: java Reporter: Svata Dedic <sdedic>
Component: UnsupportedAssignee: Svata Dedic <sdedic>
Status: CLOSED FIXED    
Severity: normal    
Priority: P4    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Svata Dedic 2000-04-18 23:55:37 UTC
If you use ClassElement.setMethods() for example always replaces entries of method collection with cloned items from the manipulator argument, not paying attention to the fact that some of the metho
ds (the same instances) are already present. They are cloned anyway.

PropertyListeners that are observing class` method(s) are still attached to the old (and now disconnected)  instances. Bad thing is, that after the replacement, getDeclaringClass().getMethods() doesn`
t list the method instance it was called on.


[Svata-update] The above applies for JavaLoader-based implementation as well. clazz.setMethods(clazz.getMethods()) edits the source file although there`s no point in doing that.
Comment 1 Svata Dedic 2001-03-01 18:11:11 UTC
Reopening -- refactored module allows to solve it.
Comment 2 Svata Dedic 2001-03-01 18:11:56 UTC
Fixed in the new implementation of java module.
memory-represented classes still suffer from this bug, but given their usage, the impact is very minor.
Comment 3 Quality Engineering 2003-07-01 13:19:40 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.