mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
don't cast when instaceofing List<String> to ArrayList
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class A {
|
||||
void foo(List<String> l) {
|
||||
if (l instanceof ArrayList) {
|
||||
l.ge<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class A {
|
||||
void foo(List<String> l) {
|
||||
if (l instanceof ArrayList) {
|
||||
l.get(<caret>)
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
@@ -1324,4 +1324,6 @@ public class ListUtils {
|
||||
|
||||
}
|
||||
|
||||
public void testListArrayListCast() { doTest('\n') }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user