Bug 11627

Summary: Refactoring: CCE in Pullup method
Product: [Eclipse Project] JDT Reporter: Erich Gamma <erich_gamma>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: akiezun
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Erich Gamma CLA 2002-03-19 06:20:13 EST
tried to pull-up ActiveTestSuite run

Log: Wed Mar 20 00:20:45 GMT+01:00 2002
4 org.eclipse.jdt.ui 1 Internal Error
java.lang.reflect.InvocationTargetException: java.lang.ClassCastException: 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
	at 
org.eclipse.jdt.internal.core.search.matching.DeclarationOfReferencedTypesPatter
n.reportDeclaration(DeclarationOfReferencedTypesPattern.java:97)
	at 
org.eclipse.jdt.internal.core.search.matching.DeclarationOfReferencedTypesPatter
n.matchReportReference(DeclarationOfReferencedTypesPattern.java:78)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportReference
(MatchLocator.java:993)
	at org.eclipse.jdt.internal.core.search.matching.MatchSet.reportMatching
(MatchSet.java:161)
	at org.eclipse.jdt.internal.core.search.matching.MatchSet.reportMatching
(MatchSet.java:338)
	at org.eclipse.jdt.internal.core.search.matching.MatchSet.reportMatching
(MatchSet.java:246)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchingOpenable.locateMatchesInCo
mpilationUnit(MatchingOpenable.java:295)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchingOpenable.locateMatches
(MatchingOpenable.java:155)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:1281)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:567)
	at 
org.eclipse.jdt.core.search.SearchEngine.searchDeclarationsOfReferencedTypes
(SearchEngine.java:626)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil.getTyp
eReferencesIn(ReferenceFinderUtil.java:48)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil.getTyp
eReferencesIn(ReferenceFinderUtil.java:40)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil.getTyp
esReferencedIn(ReferenceFinderUtil.java:31)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoring.checkAcc
essedTypes(PullUpRefactoring.java:406)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoring.checkAcc
esses(PullUpRefactoring.java:398)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoring.checkInp
ut(PullUpRefactoring.java:304)
	at org.eclipse.jdt.internal.ui.refactoring.CheckConditionsOperation.run
(CheckConditionsOperation.java:58)
	at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run
(CreateChangeOperation.java:93)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)
Comment 1 Adam Kiezun CLA 2002-03-19 06:28:39 EST
looks like a search problem
Comment 2 Philipe Mulet CLA 2002-03-20 05:36:06 EST
Cast occurs inside DeclarationOfReferencedTypesPattern#reportDeclaration
when the typeBinding argument is a binary type.

...
TypeDeclaration typeDecl = ((SourceTypeBinding)typeBinding)...;
Comment 3 Adam Kiezun CLA 2002-03-20 10:03:35 EST
*** Bug 11860 has been marked as a duplicate of this bug. ***
Comment 4 Jerome Lanneluc CLA 2002-03-20 11:51:13 EST
Cannot reproduce. Could you please send me your workspace?
Comment 5 Jerome Lanneluc CLA 2002-03-20 14:28:35 EST
Problem occured only if src=bin and autobuild on. In this case, the file name 
environment used by search used to give priority to binaries.

We now pass to the ClasspathDirectory the mode in which it is supposed to 
retrieve the types: SOURCE or BINARY. In the former mode, it will ignore 
binaries, in the latter it will ignore the source files.