don't cast when instaceofing List<String> to ArrayList

This commit is contained in:
peter
2012-03-14 14:40:14 +04:00
parent 67cf00696c
commit 205d9f807e
4 changed files with 33 additions and 2 deletions
@@ -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>)
}
}
}
@@ -1324,4 +1324,6 @@ public class ListUtils {
}
public void testListArrayListCast() { doTest('\n') }
}