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 132160

Summary: ClassCastException on root node inside Evaluate Expression Result tree
Product: debugger Reporter: Jiri Vagner <jvagner>
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: VERIFIED FIXED    
Severity: blocker CC: sustaining
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: exc.txt

Description Jiri Vagner 2008-04-07 09:57:21 UTC
Steps to reproduce:
 - open MemoryView project
 - open LongArrays.java file
 - set line breakpoin on line 38 and debug file
 - run Run > Evaluete Expression
 - type "a" inside textfield and press enter key
 - click left mouse on "a" node inside Result tree


java.lang.ClassCastException: org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj cannot be cast to
org.netbeans.api.debugger.jpda.ObjectVariable
	at org.netbeans.modules.debugger.jpda.heapwalk.models.HeapActionsFilter$1.isEnabled(HeapActionsFilter.java:113)
	at org.netbeans.spi.viewmodel.Models$ActionSupport.isEnabled(Models.java:505)
	at org.openide.awt.Actions$MenuBridge.updateState(Actions.java:902)
	at org.openide.awt.Actions.connect(Actions.java:196)
...


Product Version: NetBeans IDE Dev (Build 200804032041)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Comment 1 Jiri Vagner 2008-04-07 09:59:23 UTC
Created attachment 59757 [details]
exc.txt
Comment 2 Martin Entlicher 2008-04-07 13:29:45 UTC
Reproduced.
The problem is that selected node happens to be the last selected node in the IDE before Evaluate Expression dialog was
invoked.
Comment 3 rbalada 2008-06-05 12:02:44 UTC
I was able to reproduce it only on JDK 1.6.x . I was unable to reproduce when using JDK 1.5.x.

Added "instanceof" check before type conversion.
Fix integrated into main as http://hg.netbeans.org/main/rev/023dc55cea5d
Comment 4 Quality Engineering 2008-06-05 15:50:18 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #239 build
Changeset: http://hg.netbeans.org/main/rev/023dc55cea5d
User: Rudolf Balada <rbalada@netbeans.org>
Log: #132160: ClassCastException on root node inside Evaluate Expression Result tree
Comment 5 Peter Pis 2008-06-06 09:36:40 UTC
Fixed.
Comment 6 Peter Pis 2008-06-06 09:37:02 UTC
Verified for both 1.5 and 1.6 in Product Version: NetBeans IDE Dev (Build 200806060005)
Comment 7 jinb 2008-06-09 16:31:58 UTC
fix backported into release61_fixes branch
http://hg.netbeans.org/release61_fixes/rev/8c1c9ba079f6
Comment 8 Peter Pis 2008-06-19 09:48:52 UTC
Verified with patch2.