Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336322 - [1.7][search]CCE while searching for a type reference in multiple catch parameters
Summary: [1.7][search]CCE while searching for a type reference in multiple catch param...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 04:20 EST by Satyam Kandula CLA
Modified: 2011-08-05 02:54 EDT (History)
2 users (show)

See Also:


Attachments
Patch (4.63 KB, patch)
2011-02-04 04:47 EST, Satyam Kandula CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Satyam Kandula CLA 2011-02-04 04:20:57 EST
#####
public class Test {
	public void foo() {
		try {}
		catch (Exception | RuntimeException e) {}
	}
}
#####
With the above testcase, search for the type RuntimeException in catch clause gives the following CCE. 
#################
java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.ast.DisjunctiveTypeReference cannot be cast to org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference
at org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.match(TypeReferenceLocator.java:92)
at org.eclipse.jdt.internal.core.search.matching.MatchLocatorParser.consumeStatementCatch(MatchLocatorParser.java:535)
at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5937)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9615)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9951)
at org.eclipse.jdt.internal.core.search.matching.MatchLocatorParser.parseBodies(MatchLocatorParser.java:830)
at org.eclipse.jdt.internal.core.search.matching.MatchLocatorParser.parseBodies(MatchLocatorParser.java:804)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getMethodBodies(MatchLocator.java:858)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.parseAndBuildBindings(MatchLocator.java:1598)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1019)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1124)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1241)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:231)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:515)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:584)
at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:144)
at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Satyam Kandula CLA 2011-02-04 04:47:53 EST
Created attachment 188299 [details]
Patch

Took care of the newly introduced DisjunctiveTypeReference.
Comment 2 Satyam Kandula CLA 2011-02-04 04:56:37 EST
Released in the BETA_JAVA7 branch
Comment 3 Ayushman Jain CLA 2011-06-29 05:59:07 EDT
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.