mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
disable stream api conversion on iterable (IDEA-124222)
This commit is contained in:
@@ -76,7 +76,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
|
||||
final PsiStatement body = statement.getBody();
|
||||
if (iteratedValue != null && body != null) {
|
||||
final PsiType iteratedValueType = iteratedValue.getType();
|
||||
if (InheritanceUtil.isInheritor(iteratedValueType, CommonClassNames.JAVA_LANG_ITERABLE)) {
|
||||
if (InheritanceUtil.isInheritor(iteratedValueType, CommonClassNames.JAVA_UTIL_COLLECTION)) {
|
||||
final PsiClass iteratorClass = PsiUtil.resolveClassInType(iteratedValueType);
|
||||
LOG.assertTrue(iteratorClass != null);
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace with forEach" "false"
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class Sample {
|
||||
Iterable<String> foo = new ArrayList<>();
|
||||
String foo(){
|
||||
for (String s : fo<caret>o) {
|
||||
if (s == null) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user