mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use boxed type instead of expected primitive when NULL type is calculated
this allows int -> Integer signature changes when null is passed where primitive is expected (IDEA-164942)
This commit is contained in:
@@ -393,6 +393,9 @@ public class RefactoringUtil {
|
||||
ExpectedTypeInfo[] infos = ExpectedTypesProvider.getExpectedTypes(expr, false);
|
||||
if (infos.length == 1) {
|
||||
type = infos[0].getType();
|
||||
if (type instanceof PsiPrimitiveType) {
|
||||
type = ((PsiPrimitiveType)type).getBoxedType(expr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
type = factory.createTypeByFQClassName(CommonClassNames.JAVA_LANG_OBJECT, expr.getResolveScope());
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Change 1st parameter of method 'bar' from 'int' to 'Integer'" "true"
|
||||
public class Bar {
|
||||
void bar(Integer i) { }
|
||||
{ bar(null);}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Change 1st parameter of method 'bar' from 'int' to 'Integer'" "true"
|
||||
public class Bar {
|
||||
void bar(int i) { }
|
||||
{ bar(n<caret>ull);}
|
||||
}
|
||||
Reference in New Issue
Block a user