diff --git a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationStatementProcessor.java b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationStatementProcessor.java index b9496f0e263c..34abe924cc62 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationStatementProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationStatementProcessor.java @@ -464,7 +464,9 @@ class TypeMigrationStatementProcessor extends JavaRecursiveElementVisitor { case TypeInfection.RIGHT_INFECTED: PsiType psiType = migrationType != null ? migrationType : right.getType(); - if (psiType != null && declarationType != null && !myLabeler.addMigrationRoot(variable, psiType, myStatement, TypeConversionUtil.isAssignable(declarationType, psiType), true)) { + if (psiType != null && declarationType != null && + !myLabeler.addMigrationRoot(variable, psiType, myStatement, TypeConversionUtil.isAssignable(declarationType, psiType), true) && + !TypeConversionUtil.isAssignable(left.getType(), psiType)) { myLabeler.convertExpression(value, psiType, left.getType(), isCovariantPosition); } break;