type migration tests fixed
authorDmitry Batkovich <batya239@gmail.com>
Wed, 9 Dec 2015 19:49:42 +0000 (22:49 +0300)
committerDmitry Batkovich <batya239@gmail.com>
Wed, 9 Dec 2015 19:49:42 +0000 (22:49 +0300)
java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java

index 1161f68490be95df8c89e04abb3e0da2fce8eeff..681e5a5a74af1c0bd49ca84e44efb21a544b0118 100644 (file)
@@ -468,9 +468,10 @@ public class TypeMigrationLabeler {
 
     if (!userDefinedType) {
       final Set<PsiTypeParameter> collector;
 
     if (!userDefinedType) {
       final Set<PsiTypeParameter> collector;
-      if (originalType instanceof PsiClassReferenceType) {
+      final PsiType rootInitialType = getElementType(getCurrentRoot().getElement());
+      if (rootInitialType  instanceof PsiClassReferenceType) {
         collector = new HashSet<PsiTypeParameter>();
         collector = new HashSet<PsiTypeParameter>();
-        final PsiJavaCodeReferenceElement reference = ((PsiClassReferenceType)originalType).getReference();
+        final PsiJavaCodeReferenceElement reference = ((PsiClassReferenceType)rootInitialType).getReference();
         RefactoringUtil.collectTypeParameters(collector, reference);
       } else {
         collector = Collections.emptySet();
         RefactoringUtil.collectTypeParameters(collector, reference);
       } else {
         collector = Collections.emptySet();