mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
stream api: shorten class references when replace with foreach
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with forEach" "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class Sample {
|
||||
List<Exception> foo = new ArrayList<>();
|
||||
{
|
||||
foo.forEach(Exception::printStackTrace);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with forEach" "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class Sample {
|
||||
List<Exception> foo = new ArrayList<>();
|
||||
{
|
||||
for (Exception e : fo<caret>o) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user