mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java intention: Quick fix for error "foreach not applicable to type java.util.Iterator" - a test added (IDEA-124751)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace 'for each' loop with iterator 'for' loop" "true"
|
||||
import java.util.Iterator;
|
||||
|
||||
public class FinalItem {
|
||||
void foo(Iterator<Integer> it) {
|
||||
for (Iterator<Integer> it1 = it; it1.hasNext(); ) {
|
||||
final Integer integer = it1.next();
|
||||
System.out.println(integer);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace 'for each' loop with iterator 'for' loop" "true"
|
||||
import java.util.Iterator;
|
||||
|
||||
public class FinalItem {
|
||||
void foo(Iterator<Integer> it) {
|
||||
for (Integer integer : <caret>it) System.out.println(integer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user