Skip to content

Commit 8e55189

Browse files
committed
Java: Add tests for generic interfaces/classes/methods
1 parent 6e78aac commit 8e55189

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

java/ql/test/utils/modeleditor/ApplicationModeEndpoints.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
| com/github/codeql/test/PublicClass.java:15:24:15:44 | get(...) | java.nio.file.Paths#get(String,String[]) | true | supported | rt.jar | | sink | type | source | classification |
66
| com/github/codeql/test/PublicClass.java:15:24:15:44 | get(...) | java.nio.file.Paths#get(String,String[]) | true | supported | rt.jar | | summary | type | source | classification |
77
| com/github/codeql/test/PublicClass.java:19:5:19:27 | println(...) | java.io.PrintStream#println(String) | true | supported | rt.jar | | sink | type | source | classification |
8+
| com/github/codeql/test/PublicGenericClass.java:7:5:7:27 | println(...) | java.io.PrintStream#println(Object) | true | supported | rt.jar | | sink | type | source | classification |
9+
| com/github/codeql/test/PublicGenericClass.java:11:5:11:27 | println(...) | java.io.PrintStream#println(Object) | true | supported | rt.jar | | sink | type | source | classification |
10+
| com/github/codeql/test/PublicGenericInterface.java:8:7:8:29 | println(...) | java.io.PrintStream#println(String) | true | supported | rt.jar | | sink | type | source | classification |
811
| com/github/codeql/test/PublicInterface.java:7:7:7:29 | println(...) | java.io.PrintStream#println(String) | true | supported | rt.jar | | sink | type | source | classification |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
| com/github/codeql/test/PublicClass.java:6:15:6:19 | stuff | com.github.codeql.test.PublicClass#stuff(String) | false | supported | test | library | | type | unknown | classification |
22
| com/github/codeql/test/PublicClass.java:10:22:10:32 | staticStuff | com.github.codeql.test.PublicClass#staticStuff(String) | false | supported | test | library | | type | unknown | classification |
33
| com/github/codeql/test/PublicClass.java:14:18:14:31 | nonPublicStuff | com.github.codeql.test.PublicClass#nonPublicStuff(String) | false | supported | test | library | | type | unknown | classification |
4+
| com/github/codeql/test/PublicGenericClass.java:6:15:6:19 | stuff | com.github.codeql.test.PublicGenericClass#stuff(Object) | false | supported | test | library | | type | unknown | classification |
5+
| com/github/codeql/test/PublicGenericClass.java:10:20:10:25 | stuff2 | com.github.codeql.test.PublicGenericClass#stuff2(Object) | false | supported | test | library | | type | unknown | classification |
6+
| com/github/codeql/test/PublicGenericInterface.java:4:17:4:21 | stuff | com.github.codeql.test.PublicGenericInterface#stuff(Object) | false | supported | test | library | | type | unknown | classification |
7+
| com/github/codeql/test/PublicGenericInterface.java:5:22:5:27 | stuff2 | com.github.codeql.test.PublicGenericInterface#stuff2(Object) | false | supported | test | library | | type | unknown | classification |
8+
| com/github/codeql/test/PublicGenericInterface.java:7:24:7:34 | staticStuff | com.github.codeql.test.PublicGenericInterface#staticStuff(String) | false | supported | test | library | | type | unknown | classification |
49
| com/github/codeql/test/PublicInterface.java:4:17:4:21 | stuff | com.github.codeql.test.PublicInterface#stuff(String) | false | supported | test | library | | type | unknown | classification |
510
| com/github/codeql/test/PublicInterface.java:6:24:6:34 | staticStuff | com.github.codeql.test.PublicInterface#staticStuff(String) | false | supported | test | library | | type | unknown | classification |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.github.codeql.test;
2+
3+
import java.nio.file.Paths;
4+
5+
public class PublicGenericClass<T, T2> implements PublicGenericInterface<T> {
6+
public void stuff(T arg) {
7+
System.out.println(arg);
8+
}
9+
10+
public <T3> void stuff2(T3 arg) {
11+
System.out.println(arg);
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.github.codeql.test;
2+
3+
public interface PublicGenericInterface<T> {
4+
public void stuff(T arg);
5+
public <T2> void stuff2(T2 arg);
6+
7+
public static void staticStuff(String arg) {
8+
System.out.println(arg);
9+
}
10+
}

0 commit comments

Comments
 (0)