mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
type migration: don't process statement body when only condition is to be migrated (IDEA-197635)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
class ChangeIteratorTypeFail {
|
||||
|
||||
private static void test(List<String> greeting) {
|
||||
|
||||
final String[] helloBugArray = new String[] { "Hello", ",", " ", "bug", "!" };
|
||||
|
||||
Ite<caret>rator iterator = greeting.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
String userGreeting = (String) iterator.next();
|
||||
System.out.println(userGreeting);
|
||||
|
||||
String bugGreeting = Arrays
|
||||
.stream(helloBugArray, 0, helloBugArray.length)
|
||||
.collect(Collectors.joining(""));
|
||||
|
||||
System.out.println(bugGreeting);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
class ChangeIteratorTypeFail {
|
||||
|
||||
private static void test(List<String> greeting) {
|
||||
|
||||
final String[] helloBugArray = new String[] { "Hello", ",", " ", "bug", "!" };
|
||||
|
||||
Iterator<String> iterator = greeting.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
String userGreeting = (String) iterator.next();
|
||||
System.out.println(userGreeting);
|
||||
|
||||
String bugGreeting = Arrays
|
||||
.stream(helloBugArray, 0, helloBugArray.length)
|
||||
.collect(Collectors.joining(""));
|
||||
|
||||
System.out.println(bugGreeting);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user