Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350767

Summary: [1.7][assist] CCE while invoking assist on a multi-catch block
Product: [Eclipse Project] JDT Reporter: Ayushman Jain <amj87.iitr>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed fix v1.0 + regression tests none

Description Ayushman Jain CLA 2011-06-30 02:08:03 EDT
BETA_JAVA7

public class X {
    public void foo(boolean bool) throws Exception {
        try {
            if (bool) 
                throw new Exception();
            else
                throw new NullPointerException();
        } catch (NullPointerException[] | RunExce<CTRL_SPACE>) {
        } 
    }
}

Inovke content assist at the mentioned place above and you get
java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
	at org.eclipse.jdt.internal.codeassist.ThrownExceptionFinder.removeCaughtExceptions(ThrownExceptionFinder.java:165)
Comment 1 Ayushman Jain CLA 2011-06-30 04:12:29 EDT
Created attachment 198879 [details]
proposed fix v1.0 + regression tests

Added instanceof checks in ThrownExceptionFinder
Comment 2 Ayushman Jain CLA 2011-07-01 09:40:07 EDT
Released in BETA_JAVA7 branch
Comment 3 Curtis Windatt CLA 2011-07-19 16:40:55 EDT
Verified in I20110613-1736 using the patch from 20110714-1400