mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 08:45:34 +07:00
StreamToLoopInspection: fixed unqualified reference to stream() method handling
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
void test() {
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int sum = 0;
|
||||
for (String s : Test.this) {
|
||||
int length = s.length();
|
||||
sum += length;
|
||||
}
|
||||
System.out.println(sum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Test extends ArrayList<String> {
|
||||
void test() {
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(stream().mapToInt(String::length).s<caret>um());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user