mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Java: Don't inherit methods from co-/contra-variant supertypes.
This commit is contained in:
@@ -1 +1 @@
|
||||
| NamingTest.java:4:17:4:22 | equals | Method NamingTest.equals(..) could be confused with overloaded method $@, since dispatch depends on static types. | NamingTest.java:3:17:3:22 | equals | equals |
|
||||
| NamingTest.java:7:17:7:22 | equals | Method NamingTest.equals(..) could be confused with overloaded method $@, since dispatch depends on static types. | NamingTest.java:6:17:6:22 | equals | equals |
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
import java.util.*;
|
||||
import java.util.function.*;
|
||||
import java.util.stream.*;
|
||||
|
||||
public class NamingTest {
|
||||
public boolean equals(Object other) { return false; }
|
||||
public boolean equals(NamingTest other) { return true; }
|
||||
|
||||
|
||||
public void visit(Object node) {}
|
||||
public void visit(NamingTest t) {}
|
||||
|
||||
public class Elem<T> {}
|
||||
|
||||
public Object get(List<Elem<String>> lll) {
|
||||
Predicate<?> p = null;
|
||||
p.test(null);
|
||||
return lll.stream().map(l -> l).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user