Fix and add test for java/subtle-inherited-call involving inheritence from generic types

This commit is contained in:
Chris Smowton
2022-09-14 21:23:04 +01:00
parent da04673cb0
commit b926bc9efa
5 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
| GenericTest.java:14:7:14:9 | f(...) | A $@ is called instead of a $@. | GenericTest.class:0:0:0:0 | f | method declared in a superclass | GenericTest.java:9:8:9:8 | f | method with the same signature in an enclosing class |
| Test.java:14:7:14:9 | f(...) | A $@ is called instead of a $@. | Test.java:3:8:3:8 | f | method declared in a superclass | Test.java:9:8:9:8 | f | method with the same signature in an enclosing class |

View File

@@ -0,0 +1 @@
Violations of Best Practice/Naming Conventions/AmbiguousOuterSuper.ql

View File

@@ -0,0 +1,19 @@
public class GenericTest<T> {
void f() { }
}
class Outer2 {
void f() { }
class Inner<T> extends GenericTest<T> {
public void test() {
f();
}
}
}

View File

@@ -0,0 +1,19 @@
public class Test {
void f() { }
}
class Outer {
void f() { }
class Inner extends Test {
public void test() {
f();
}
}
}