Skip to content

Commit 882237e

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: update test cases affected by Duration.ofMillis and AtomicReference.set models
1 parent bdd7f18 commit 882237e

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

java/ql/test/query-tests/Telemetry/SupportedExternalApis/SupportedExternalApis.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
| java.net.URL#openConnection() | 1 |
77
| java.net.URL#openStream() | 1 |
88
| java.net.URLConnection#getInputStream() | 1 |
9+
| java.time.Duration#ofMillis(long) | 1 |
910
| java.util.Map#put(Object,Object) | 1 |
1011
| org.apache.commons.io.FileUtils#deleteDirectory(File) | 1 |

java/ql/test/query-tests/Telemetry/SupportedExternalApis/SupportedExternalApis.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ public static void main(String[] args) throws Exception {
1616
Map<String, Object> map = new HashMap<>(); // uninteresting (parameterless constructor)
1717
map.put("foo", new Object()); // supported summary
1818

19-
Duration d = java.time.Duration.ofMillis(1000); // not supported
19+
Duration d = java.time.Duration.ofMillis(1000); // supported neutral
2020

2121
URL github = new URL("https://www.github.com/"); // supported summary
2222
InputStream stream = github.openConnection().getInputStream(); // supported source (getInputStream), supported sink (openConnection)
2323

2424
new FileWriter(new File("foo")); // supported sink (FileWriter), supported summary (File)
2525
new URL("http://foo").openStream(); // supported sink (openStream), supported summary (URL)
2626

27-
FileUtils.deleteDirectory(new File("foo")); // supported negative summary (deleteDirectory), supported summary (File)
27+
FileUtils.deleteDirectory(new File("foo")); // supported neutral (deleteDirectory), supported summary (File)
2828
}
2929
}

java/ql/test/query-tests/Telemetry/UnsupportedExternalAPIs/Test.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ public static void main(String[] args) {
1111
Map<String, Object> map = new HashMap<>();
1212
map.put("foo", new Object());
1313

14-
Duration d = java.time.Duration.ofMillis(1000); // not supported
14+
Duration d = java.time.Duration.ofMillis(1000); // supported as a neutral model
1515

1616
long l = "foo".length(); // supported as a neutral model
1717

18-
AtomicReference<String> ref = new AtomicReference<>(); // not supported
19-
ref.set("foo");
18+
AtomicReference<String> ref = new AtomicReference<>(); // uninteresting (parameterless constructor)
19+
ref.set("foo"); // supported as a summary model
20+
ref.toString(); // not supported
2021

2122
String.class.isAssignableFrom(Object.class); // parameter with generic type, supported as a neutral model
2223

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
| java.time.Duration#ofMillis(long) | 1 |
2-
| java.util.concurrent.atomic.AtomicReference#set(Object) | 1 |
1+
| java.util.concurrent.atomic.AtomicReference#toString() | 1 |

0 commit comments

Comments
 (0)