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 252784

Summary: ClassCastException: org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor$ShortVal cannot be cast to com.sun.jdi.ObjectReference
Product: debugger Reporter: luis.boch
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 217718
Attachments: stacktrace

Description luis.boch 2015-06-03 20:14:32 UTC
This bug was originally marked as duplicate of bug 240034, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 8.0.2 (Build 201408251540)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.80-b11, Java(TM) SE Runtime Environment, 1.7.0_80-b15
OS: Linux

User Comments:
luis.boch: Evaluating value from debugger.




Stacktrace: 
java.lang.ClassCastException: org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor$ShortVal cannot be cast to com.sun.jdi.ObjectReference
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitMethodInvocation(EvaluatorVisitor.java:413)
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitMethodInvocation(EvaluatorVisitor.java:205)
   at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1483)
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitExpressionStatement(EvaluatorVisitor.java:1678)
   at org.netbeans.modules.debugger.jpda.expr.EvaluatorVisitor.visitExpressionStatement(EvaluatorVisitor.java:205)
   at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1308)
Comment 1 luis.boch 2015-06-03 20:14:34 UTC
Created attachment 154041 [details]
stacktrace
Comment 2 Martin Entlicher 2015-06-04 07:35:33 UTC
Reproduced. To reproduce, evaluate this expression:
((Double) 5.0).intValue()
Comment 3 Martin Entlicher 2015-06-04 14:05:58 UTC
Fixed by changeset:   288587:0906094af9b1
http://hg.netbeans.org/core-main/rev/0906094af9b1
Comment 4 Quality Engineering 2015-06-05 02:39:30 UTC
Integrated into 'main-silver', will be available in build *201506050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0906094af9b1
User: mentlicher@netbeans.org
Log: #252784: Evaluate expressions, where primitive types are explicitly cast to their object counterparts.