From 4ec547f4bb597ae2176d7ddc2f15776b3ca6e3fd Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 21 Oct 2013 17:53:31 +0200 Subject: [PATCH] type migration: avoid migration from primitive to boxed and vice versa (IDEA-114902) --- .../typeMigration/rules/RootTypeConversionRule.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/java-impl/src/com/intellij/refactoring/typeMigration/rules/RootTypeConversionRule.java b/java/java-impl/src/com/intellij/refactoring/typeMigration/rules/RootTypeConversionRule.java index c32b873207fa..052d27ab66c0 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeMigration/rules/RootTypeConversionRule.java +++ b/java/java-impl/src/com/intellij/refactoring/typeMigration/rules/RootTypeConversionRule.java @@ -84,8 +84,9 @@ public class RootTypeConversionRule extends TypeConversionRule { type = superClassSubstitutor.substitute(type); } - if (!originalType.equals(type)) { - labeler.migrateExpressionType(actualParams[i], methodTypeParamsSubstitutor.substitute(type), context, false, true); + final PsiType migrationType = methodTypeParamsSubstitutor.substitute(type); + if (!originalType.equals(migrationType) && !TypeConversionUtil.areTypesAssignmentCompatible(migrationType, actualParams[i])) { + labeler.migrateExpressionType(actualParams[i], migrationType, context, false, true); } } }