mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
redundant assignment in arg list fixed (IDEA-126190)
This commit is contained in:
@@ -40,7 +40,7 @@ public class RemoveAssignmentFix extends RemoveInitializerFix {
|
||||
if (!(parent instanceof PsiAssignmentExpression)) return;
|
||||
final PsiExpression rExpression = ((PsiAssignmentExpression)parent).getRExpression();
|
||||
final PsiElement gParent = parent.getParent();
|
||||
if (gParent instanceof PsiExpression && rExpression != null) {
|
||||
if ((gParent instanceof PsiExpression || gParent instanceof PsiExpressionList) && rExpression != null) {
|
||||
if (!FileModificationService.getInstance().prepareFileForWrite(gParent.getContainingFile())) return;
|
||||
if (gParent instanceof PsiParenthesizedExpression) {
|
||||
gParent.replace(rExpression);
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove redundant assignment" "true"
|
||||
class Test {
|
||||
void foo() {
|
||||
String var;
|
||||
this.bar("someString");
|
||||
}
|
||||
|
||||
void bar(String arg) {
|
||||
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove redundant assignment" "true"
|
||||
class Test {
|
||||
void foo() {
|
||||
String var;
|
||||
this.bar(v<caret>ar = "someString");
|
||||
}
|
||||
|
||||
void bar(String arg) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user