EA-33078 - assert: TypeMigrationLabeler.migrateExpressionType
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Wed, 1 Feb 2012 07:54:16 +0000 (11:54 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Wed, 1 Feb 2012 07:59:40 +0000 (11:59 +0400)
skip expressions with null type

java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java
java/java-impl/src/com/intellij/refactoring/typeMigration/rules/RootTypeConversionRule.java

index c6d7611c75affe73dcc5603c0fc264f512244252..0dcb61f2251d57f7b91ae7c82247a38bb2e32761 100644 (file)
@@ -249,9 +249,7 @@ public class TypeMigrationLabeler {
   public void migrateExpressionType(final PsiExpression expr, final PsiType migrationType, final PsiElement place, boolean alreadyProcessed, final boolean isCovariant) {
     PsiType originalType = expr.getType();
 
   public void migrateExpressionType(final PsiExpression expr, final PsiType migrationType, final PsiElement place, boolean alreadyProcessed, final boolean isCovariant) {
     PsiType originalType = expr.getType();
 
-    LOG.assertTrue(originalType != null);
-
-    if (originalType.equals(migrationType)) return;
+    if (originalType == null || originalType.equals(migrationType)) return;
 
     if (originalType.equals(PsiType.NULL)) {
       if (migrationType instanceof PsiPrimitiveType) {
 
     if (originalType.equals(PsiType.NULL)) {
       if (migrationType instanceof PsiPrimitiveType) {
index 37920f4583cc53757bd62c8615d32de48da58c91..c32b873207fa58a47899207edf926fa6d2b4efbe 100644 (file)
@@ -85,7 +85,7 @@ public class RootTypeConversionRule extends TypeConversionRule {
               }
 
               if (!originalType.equals(type)) {
               }
 
               if (!originalType.equals(type)) {
-                labeler.migrateExpressionType(actualParams[i], methodTypeParamsSubstitutor.substitute(type), context, originalType.equals(type), true);
+                labeler.migrateExpressionType(actualParams[i], methodTypeParamsSubstitutor.substitute(type), context, false, true);
               }
             }
           }
               }
             }
           }