mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
ExpressionUtils#getQualifierOrThis; ForCanBeForeachInspection & WhileCanBeForeachInspection fixed to handle unqualified calls in nested classes; cosmetics; tests for ForCanBeForeachInspection quick fix
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'foreach'" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
public void print() {
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (String s : Test.this) {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'foreach'" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
public void print() {
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (String s : Test.this) {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'foreach'" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
public void print() {
|
||||
for (String s : this) {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'foreach'" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
public void print() {
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fo<caret>r (int i = 0; i < size(); i++) {
|
||||
System.out.println(get(i));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'foreach'" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
public void print() {
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fo<caret>r (Iterator<String> it = iterator(); it.hasNext(); ) {
|
||||
System.out.println(it.next());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'foreach'" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
public void print() {
|
||||
fo<caret>r (int i = 0; i < size(); i++) {
|
||||
System.out.println(get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user