StreamToLoopInspection: simplify getEffectiveQualifier usage; support unqualified Iterable.forEach, Map.forEach

Review ID: IDEA-CR-46452

GitOrigin-RevId: 7622f0f1274d9f23bfaef88096b3eedd2b4d18a6
This commit is contained in:
Tagir Valeev
2019-04-28 14:53:13 +03:00
committed by intellij-monorepo-bot
parent 356b90a3ce
commit 9af3284048
6 changed files with 48 additions and 15 deletions
@@ -43,4 +43,14 @@ public class Main {
interface Visitor { }
}
class X implements Iterable<String> {
class Y {
void test() {
for (String s : X.this) {
System.out.println(s);
}
}
}
}
}
@@ -31,4 +31,15 @@ public class Main {
}
}
class X implements Map<String, String> {
class Y {
void test() {
for (Entry<String, String> entry : X.this.entrySet()) {
String k = entry.getKey();
String v = entry.getValue();
System.out.println(k + "-" + v);
}
}
}
}
}
@@ -33,4 +33,12 @@ public class Main {
interface Visitor { }
}
class X implements Iterable<String> {
class Y {
void test() {
forEach(System.out::println);
}
}
}
}
@@ -21,4 +21,11 @@ public class Main {
map.forEach(otherMap::putIfAbsent);
}
class X implements Map<String, String> {
class Y {
void test() {
forEach((k, v) -> System.out.println(k + "-" + v));
}
}
}
}