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 237032

Summary: IllegalStateException: Unexpected type java.lang.Exception of kind UNION in [e.getMessage()]
Product: debugger Reporter: Egor Ushakov <gorrus>
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 204518
Attachments: stacktrace

Description Egor Ushakov 2013-10-11 12:28:28 UTC
Build: NetBeans IDE 7.4 RC2 (Build 201309252201)
VM: Java HotSpot(TM) Client VM, 24.0-b56, Java(TM) SE Runtime Environment, 1.7.0_40-b43
OS: SunOS

User Comments:
gorrus: during debug




Stacktrace: 
java.lang.IllegalStateException: Unexpected type java.lang.Exception of kind UNION in [e.getMessage()]
   at org.netbeans.modules.debugger.jpda.projects.AST2Bytecode.matchSourceTree2Bytecode(AST2Bytecode.java:260)
   at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.computeOperations(EditorContextImpl.java:2723)
   at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.getOperations(EditorContextImpl.java:1748)
   at org.netbeans.modules.debugger.jpda.ExpressionPool.createExpressionAt(ExpressionPool.java:193)
   at org.netbeans.modules.debugger.jpda.ExpressionPool.getExpressionAt(ExpressionPool.java:102)
   at org.netbeans.modules.debugger.jpda.actions.StepActionProvider$2.run(StepActionProvider.java:592)
Comment 1 Egor Ushakov 2013-10-11 12:28:30 UTC
Created attachment 141011 [details]
stacktrace
Comment 2 Martin Entlicher 2013-12-16 16:03:34 UTC
To reproduce:

public class TestUnionExcs {
    
    public static void main(String[] args) {
        try {
            args[2].charAt(10);
        } catch (ArrayIndexOutOfBoundsException | NullPointerException ex) {
            String msg = ex.getMessage().trim(); // Put breakpoint here
            System.err.println(msg);
        }
    }
}

Debug that class, after it stops on the breakpoint, do Step Over Expression. The exception is thrown then.
Comment 3 Martin Entlicher 2013-12-17 18:14:50 UTC
Fixed by changeset:   269543:70c1a1cc3918
http://hg.netbeans.org/core-main/rev/70c1a1cc3918