mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
MoveConditionToLoopInspection: change name : IDEA-185134
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
while (i < 12) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
do {
|
||||
i++;
|
||||
} while (i < 12);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
// negative i is invalid - stop here
|
||||
do {
|
||||
i++;
|
||||
} while (i >= 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
/*1*/
|
||||
/*2*/
|
||||
/*3*/
|
||||
/*7*/
|
||||
/*8*/
|
||||
while (i < 12) {
|
||||
/*4*/
|
||||
i =/*5*/ i + 1;/*6*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
for<caret>(;;) {
|
||||
if(i >= 12) break;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
while<caret>(true) {
|
||||
i++;
|
||||
if(i >= 12) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
while<caret>(true) {
|
||||
i++;
|
||||
if(i < 0) {
|
||||
// negative i is invalid - stop here
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Move condition to loop" "false"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
while<caret>((true) {
|
||||
i++;
|
||||
if(i == 4) continue;
|
||||
if(i >= 12) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Move condition to loop" "false"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
while<caret>(true) {
|
||||
i++;
|
||||
int j = i;
|
||||
if(j >= 12) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Move condition to loop" "true"
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
while<caret>(true/*7*/) /*8*/ {
|
||||
if(i >= 12/*1*/)/*2*/ break;/*3*/
|
||||
/*4*/
|
||||
i =/*5*/ i + 1;/*6*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user