mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not treat boxing assignment as simple copy (IDEA-96698)
This commit is contained in:
+2
@@ -19,6 +19,7 @@ import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.siyeh.InspectionGadgetsBundle;
|
||||
import com.siyeh.ig.BaseInspection;
|
||||
import com.siyeh.ig.BaseInspectionVisitor;
|
||||
@@ -160,6 +161,7 @@ public class UnnecessaryLocalVariableInspection extends BaseInspection {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (TypeConversionUtil.boxingConversionApplicable(variable.getType(), ((PsiVariable)referent).getType())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,4 +20,9 @@ class C {
|
||||
System.out.println(r2 + r3);
|
||||
}
|
||||
}
|
||||
|
||||
int boxing(Long l) {
|
||||
long ll = l;
|
||||
return (int) ll;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user