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.
I can randomly, but quite often, reproduce ISE due to missing SourceCookie of JavaDataObject. Most often it occurs if I select some jmi element in editor and then I choose Tools menu. Strange is that the method (BridgeUtils.getElement) where it fails already holds ClassMember, its Resource and its DataObject.
Created attachment 17435 [details] ISE
*** Issue 48800 has been marked as a duplicate of this issue. ***
Steps how to reproduce it: 1) open Refactoring module 2) go to class JavaEdior 3) as soon as JavaEdior is displayed go to Tools menu 4) wait for ISE
Possible fix: Index: org/netbeans/modules/java/ui/nodes/BridgeUtils.java ===================================================== ============== RCS file: /cvs/java/src/org/netbeans/modules/java/ui/nodes/BridgeUtils.java,v retrieving revision 1.4 diff -c -r1.4 BridgeUtils.java *** org/netbeans/modules/java/ui/nodes/BridgeUtils.java 31 Aug 2004 16:21:32 -0000 1.4 --- org/netbeans/modules/java/ui/nodes/BridgeUtils.java 13 Sep 2004 16:12:17 -0000 *************** *** 86,92 **** } SourceCookie sc = (SourceCookie) d.getCookie(SourceCookie.class); if (sc == null) { ! throwIllegalState(member, "missing source cookie"); // NOI18N } SourceElement source = sc.getSource(); ClassElement[] els; --- 86,92 ---- } SourceCookie sc = (SourceCookie) d.getCookie(SourceCookie.class); if (sc == null) { ! return null; } SourceElement source = sc.getSource(); ClassElement[] els; This works OK, but Honza will try to find cleaner solution (if possible).
Tome, thanks for your patch but I am afraid it would not work under all circumstances. BridgeUtils.getElement(JavaClass) is used also by java node factories. Now I am working on a workaround for beta2 but since it will not solve the cause of this issue I have filed also the issue #48997 for openide/nodes.
fixed with workaround in /cvs/java/src/org/netbeans/modules/java/ui/nodes/BridgeUtils.java new revision: 1.5; previous revision: 1.4 /cvs/java/src/org/netbeans/modules/java/ui/nodes/JavaSourceNodeFactory.java new revision: 1.13; previous revision: 1.12
I tested patched trunk and beta2 builds with Tomas test case and I cannot reproduce it now.
the fix merged to release40_beta2 /cvs/java/src/org/netbeans/modules/java/ui/nodes/BridgeUtils.java new revision: 1.4.4.1; previous revision: 1.4 /cvs/java/src/org/netbeans/modules/java/ui/nodes/JavaSourceNodeFactory.java new revision: 1.11.4.1; previous revision: 1.11