Community
Participate
Working Groups
build 3.0 + JDT/JDK_1_5 1) create a Java project 'P' 2) create a class 'X.java' public class X<T> { T t; } class T { } 3) create a package 'p' 4) Inside package explorer try to move 'X.java' to 'p' a ClassCastException occurs java.lang.ClassCastException at org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.reportDeclar ation(TypeReferenceLocator.java:327) at org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.reportDeclar ation(TypeReferenceLocator.java:308) at org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.matchReportR eference(TypeReferenceLocator.java:166) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1500) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1590) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1456) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process (MatchLocator.java:1120) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:748) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:776) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:879) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches (JavaSearchParticipant.java:94) at org.eclipse.jdt.core.search.SearchEngine.searchDeclarations (SearchEngine.java:1060) at org.eclipse.jdt.core.search.SearchEngine.searchDeclarationsOfReferencedTypes (SearchEngine.java:1204) at org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil.getTy peReferencesIn(ReferenceFinderUtil.java:63) at org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil.getTy peReferencesIn(ReferenceFinderUtil.java:55) at org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil.getTy pesReferencedIn(ReferenceFinderUtil.java:46) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.addImport ToSourcePackageTypes(MoveCuUpdateCreator.java:224) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.addUpdate s(MoveCuUpdateCreator.java:141) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.addUpdate s(MoveCuUpdateCreator.java:127) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.createCha ngeManager(MoveCuUpdateCreator.java:91) at org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory$MoveFilesF oldersAndCusPolicy.createChangeManager(ReorgPolicyFactory.java:1760) at org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory$MoveFilesF oldersAndCusPolicy.checkFinalConditions(ReorgPolicyFactory.java:1859) at ...
Works for me with latest. Can you still reproduce ?
I can reproduce with latest. I forgot to say that the compliance level must be 1.5. The problem does not occur with 1.4
I have the compliance level set to 1.5 as well. I would need more details.
My fault: missed the declaration of secondary type T.
Changed TypeReferenceLocator.reportDeclartion(ASTNode, ...) to report the erasure of the type binding instead of the type variable binding. Added regression test JavaSearchTests.testDeclarationOfReferencedTypes09()