mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Add tests for telemetry queries
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| java.time;?;Duration;ofMillis;(long) | 1 |
|
||||
@@ -0,0 +1 @@
|
||||
Telemetry/ExternalAPIUsages.ql
|
||||
@@ -0,0 +1,21 @@
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
class ExternalApiUsage {
|
||||
public static void main(String[] args) {
|
||||
List<?> foo = new ArrayList(); // already supported
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("foo", new Object());
|
||||
|
||||
Duration d = java.time.Duration.ofMillis(1000); // not supported
|
||||
|
||||
long l = "foo".length(); // not interesting
|
||||
|
||||
System.out.println(d);
|
||||
System.out.println(map);
|
||||
System.out.println(foo);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
rt.jar | 3 |
|
||||
@@ -0,0 +1 @@
|
||||
Telemetry/ExternalLibraryUsage.ql
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
class ExternalLibraryUsage {
|
||||
public static void main(String[] args) {
|
||||
List<?> foo = new ArrayList(); // Java Runtime
|
||||
System.out.println(foo);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user