From 7cecc22ed36287effa7846a902ef7f6d4d92a054 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 5 Dec 2013 19:31:30 +0100 Subject: [PATCH] type migration: do not search for conversion when types are convertible (IDEA-117634) --- .../typeMigration/TypeMigrationStatementProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;