Bug 213527 - ClassCast exception when search for Annotation type references
Summary: ClassCast exception when search for Annotation type references
Status: VERIFIED DUPLICATE of bug 211609
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-19 15:33 EST by Leho Nigul CLA
Modified: 2008-03-07 03:41 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leho Nigul CLA 2007-12-19 15:33:11 EST
Build ID: I20071127-0800

Steps To Reproduce:
In my code I invoke search API to search for references to annotation type as follows:

				try
				{
					searchEngine.search(pattern, participats, scope, requestor, null);
				}
				catch(Exception e)
				{
					e.printStackTrace();
				}

Where pattern is 
SearchPattern.createPattern(annotationType,IJavaSearchConstants.REFERENCES);

When the code is invoked, I get the exception bellow


java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding incompatible with org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.convertMemberValue(BinaryTypeBinding.java:54)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethod(BinaryTypeBinding.java:511)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethods(BinaryTypeBinding.java:560)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:329)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:731)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.cacheBinaryType(LookupEnvironment.java:175)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.cacheBinaryType(LookupEnvironment.java:162)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.cacheBinaryType(MatchLocator.java:429)
	at org.eclipse.jdt.internal.core.search.matching.ClassFileMatchLocator.locateMatches(ClassFileMatchLocator.java:81)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1511)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1022)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1063)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1185)
	at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:217)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:501)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:550)


More information:
Comment 1 Olivier Thomann CLA 2007-12-19 15:36:23 EST
Looks like a dup of bug 211609.
Please try 3.4M4 and let us know if the problem still persists.

*** This bug has been marked as a duplicate of bug 211609 ***
Comment 2 Frederic Fusier CLA 2008-03-07 03:41:09 EST
I guess it's verified, otherwise we should have got some feedback about this...