Value assigned to the variable is already assigned to it => Variable is already assigned to this value

Review ID: IDEA-CR-28206
This commit is contained in:
Tagir Valeev
2017-12-29 18:35:28 +07:00
parent bf5ab3c8d7
commit 55ceed0e09
4 changed files with 8 additions and 8 deletions
@@ -22,7 +22,7 @@ class Test {
void forLoop() {
int target = 3;
for (int current = 0; <warning descr="Condition 'current < target' is always 'true'">current < target</warning>; ) {
<warning descr="Value assigned to the variable is already assigned to it">current</warning> = 0;
<warning descr="Variable is already assigned to this value">current</warning> = 0;
}
}
@@ -40,7 +40,7 @@ class Test {
int target = 3;
while (<warning descr="Condition 'current < target' is always 'true'">current < target</warning>)
{
<warning descr="Value assigned to the variable is already assigned to it">current</warning> = 0;
<warning descr="Variable is already assigned to this value">current</warning> = 0;
}
}
@@ -9,7 +9,7 @@ public class RedundantAssignment {
if(x % 3 == 1) {
flag = true;
} else {
<warning descr="Value assigned to the variable is already assigned to it">flag</warning> = false;
<warning descr="Variable is already assigned to this value">flag</warning> = false;
}
}
System.out.println(flag);
@@ -19,14 +19,14 @@ public class RedundantAssignment {
arr[0] = 1;
arr[1] = 2;
arr[2] = 3;
<warning descr="Value assigned to the variable is already assigned to it">arr[0]</warning> = 1;
<warning descr="Variable is already assigned to this value">arr[0]</warning> = 1;
}
void withTest(int x) {
if(x != 0) {
System.out.println(x);
} else {
<warning descr="Value assigned to the variable is already assigned to it">x</warning> = 0;
<warning descr="Variable is already assigned to this value">x</warning> = 0;
}
System.out.println("oops");
}
@@ -36,7 +36,7 @@ public class RedundantAssignment {
if(b.hashCode() > 10) {
a = null;
} else {
<warning descr="Value assigned to the variable is already assigned to it">a</warning> = b;
<warning descr="Variable is already assigned to this value">a</warning> = b;
}
}
}
@@ -16,7 +16,7 @@ class Test {
}
if (!rangeMarkersDisposed) {
<warning descr="Value assigned to the variable is already assigned to it">foo</warning> = "dd";
<warning descr="Variable is already assigned to this value">foo</warning> = "dd";
}
}
}
@@ -94,7 +94,7 @@ dataflow.message.constant.method.reference=Method reference result is always ''{
dataflow.message.array.index.out.of.bounds=Array index is out of bounds
dataflow.message.immutable.modified=Immutable object is modified
dataflow.message.immutable.passed=Immutable object is passed where mutable is expected
dataflow.message.redundant.assignment=Value assigned to the variable is already assigned to it
dataflow.message.redundant.assignment=Variable is already assigned to this value
#deprecated
inspection.deprecated.display.name=Deprecated API usage