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 75126 - Invalid key DebugException from Type.getReferences().iterator()
Summary: Invalid key DebugException from Type.getReferences().iterator()
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-17 18:04 UTC by foliver
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Failing test project and target project on which it (fails to) operate (19.38 KB, application/x-compressed)
2006-04-17 18:06 UTC, foliver
Details

Note You need to log in before you can comment on or make changes to this bug.
Description foliver 2006-04-17 18:04:48 UTC
A DebugException is thrown when attempting to obtain the collection of 
references to a type parameter in an interface implemented by a class.

Example: find all references to "MyFeedback" in class "MyGenerator":

public class MyGenerator implements Generator<MyFeedback, Object, MyOutput> {
    public Task<MyFeedback, Object> generate() {
	return null;
    }
    public void consume(MyFeedback obj) {
    }
}


org.netbeans.mdr.util.DebugException: Invalid key
        at
org.netbeans.mdr.storagemodel.MdrStorage.getObjectsFromIndex(MdrStorage.java:725)
        at
org.netbeans.mdr.storagemodel.IndexImmutSet.getObjects(IndexImmutSet.java:66)
        at
org.netbeans.mdr.storagemodel.AssocEndIndexSet.iterator(AssocEndIndexSet.java:96)
        at
org.netbeans.mdr.handlers.AEIndexSetWrapper.iterator(AEIndexSetWrapper.java:186)
        at foo.refactortest.TestAction.performAction(TestAction.java:96)
        at
org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:94)
        at
org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:47)
        at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:90)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
        at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
        at java.awt.Component.processMouseEvent(Component.java:5488)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
        at org.openide.awt.ToolbarButton.processMouseEvent(ToolbarButton.java:33)
        at java.awt.Component.processEvent(Component.java:5253)
        at java.awt.Container.processEvent(Container.java:1966)
        at java.awt.Component.dispatchEventImpl(Component.java:3955)
        at java.awt.Container.dispatchEventImpl(Container.java:2024)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
        at java.awt.Container.dispatchEventImpl(Container.java:2010)
        at java.awt.Window.dispatchEventImpl(Window.java:1774)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 foliver 2006-04-17 18:06:22 UTC
Created attachment 29882 [details]
Failing test project and target project on which it (fails to) operate
Comment 2 foliver 2006-04-17 18:13:19 UTC
For the attached example:

- unzip the two projects.

- edit RefactorTest2/src/foo/refactortest/TestAction to change the
  String csProjectDir to the directory in which the RefactorTestTarget
  project was unzipped.

- build and load the RefectorTest2 module.

- Choose "Refactoring Test" from the Tools menu (or click the Valve icon).
Comment 3 foliver 2006-04-20 19:38:13 UTC
Changed to java component, as the problem appears to be in javamodel rather 
than MDR. In this example,

    public class MyGenerator
       implements Generator<MyFeedback, Object, Object> {
    ...
        public void consume(MyFeedback obj) {
        }
    }

the call to getReferences() on the ParameterizedType "MyFeedback" should return
a collection of one item (the use of that parameter in the consume method).
Instead, it returns an empty collection (which leads to the misleading
DebugException).
Comment 4 Jan Becicka 2006-05-04 14:53:32 UTC
Jirko, is it reproducible? Thanks
Comment 5 Jiri Prox 2006-05-04 15:15:17 UTC
NB 5.0 -fcs
JDK 1.5.0_05
Linux Fedora Core 2

Reproducible.
Comment 6 Jan Becicka 2006-05-04 15:19:28 UTC
Dane, can you take a look at it? Thanks
Comment 7 Daniel Prusa 2006-06-15 13:57:53 UTC
trunk:

/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ParameterizedTypeImpl.java
new revision: 1.30; previous revision: 1.29

release55:

/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ParameterizedTypeImpl.java
new revision: 1.24.2.2.2.1; previous revision: 1.24.2.2
Comment 8 Quality Engineering 2007-09-20 11:52:15 UTC
Reorganization of java component