Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350767 - [1.7][assist] CCE while invoking assist on a multi-catch block
Summary: [1.7][assist] CCE while invoking assist on a multi-catch block
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-30 02:08 EDT by Ayushman Jain CLA
Modified: 2011-08-05 02:54 EDT (History)
1 user (show)

See Also:


Attachments
proposed fix v1.0 + regression tests (6.74 KB, patch)
2011-06-30 04:12 EDT, Ayushman Jain CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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