mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
Java: Fixed removing unused variable occurrences from 'for' loop's update and init clauses (IDEA-180217)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case01() {
|
||||
int i = 10;
|
||||
for(; (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case01() {
|
||||
int i;
|
||||
for(i = 10; (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
int i = 10;
|
||||
for(foo(); (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
int i;
|
||||
for(i = 10, foo(); (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case01() {
|
||||
for(int i = 10; (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case02() {
|
||||
for(int i = 10; i > 0; i--) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
for(int i = 10; (--i) > 0; foo()) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
for(int i = 10; i > 0; --i, foo()) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case01() {
|
||||
Object <caret>problematic;
|
||||
int i = 10;
|
||||
for(problematic = foo; (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case01() {
|
||||
Object <caret>problematic;
|
||||
int i;
|
||||
for(i = 10, problematic = foo; (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
Object <caret>problematic;
|
||||
int i = 10;
|
||||
for(problematic = foo(); (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
Object <caret>problematic;
|
||||
int i;
|
||||
for(i = 10, problematic = foo(); (--i) > 0; ) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case01() {
|
||||
Object <caret>problematic;
|
||||
for(int i = 10; (--i) > 0; problematic = foo) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo = null;
|
||||
|
||||
void case02() {
|
||||
Object <caret>problematic;
|
||||
for(int i = 10; i > 0; i--, problematic = foo) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
Object <caret>problematic;
|
||||
for(int i = 10; (--i) > 0; problematic = foo()) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'problematic'" "true"
|
||||
class C {
|
||||
Object foo() {return null;}
|
||||
|
||||
void case01() {
|
||||
Object <caret>problematic;
|
||||
for(int i = 10; i > 0; --i, problematic = foo()) {
|
||||
System.out.println("index = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user