mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Java: update test cases affected by Duration.ofMillis and AtomicReference.set models
This commit is contained in:
@@ -6,5 +6,6 @@
|
||||
| java.net.URL#openConnection() | 1 |
|
||||
| java.net.URL#openStream() | 1 |
|
||||
| java.net.URLConnection#getInputStream() | 1 |
|
||||
| java.time.Duration#ofMillis(long) | 1 |
|
||||
| java.util.Map#put(Object,Object) | 1 |
|
||||
| org.apache.commons.io.FileUtils#deleteDirectory(File) | 1 |
|
||||
|
||||
@@ -16,7 +16,7 @@ class SupportedExternalApis {
|
||||
Map<String, Object> map = new HashMap<>(); // uninteresting (parameterless constructor)
|
||||
map.put("foo", new Object()); // supported summary
|
||||
|
||||
Duration d = java.time.Duration.ofMillis(1000); // not supported
|
||||
Duration d = java.time.Duration.ofMillis(1000); // supported neutral
|
||||
|
||||
URL github = new URL("https://www.github.com/"); // supported summary
|
||||
InputStream stream = github.openConnection().getInputStream(); // supported source (getInputStream), supported sink (openConnection)
|
||||
@@ -24,6 +24,6 @@ class SupportedExternalApis {
|
||||
new FileWriter(new File("foo")); // supported sink (FileWriter), supported summary (File)
|
||||
new URL("http://foo").openStream(); // supported sink (openStream), supported summary (URL)
|
||||
|
||||
FileUtils.deleteDirectory(new File("foo")); // supported negative summary (deleteDirectory), supported summary (File)
|
||||
FileUtils.deleteDirectory(new File("foo")); // supported neutral (deleteDirectory), supported summary (File)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,13 @@ class ExternalApiUsage {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("foo", new Object());
|
||||
|
||||
Duration d = java.time.Duration.ofMillis(1000); // not supported
|
||||
Duration d = java.time.Duration.ofMillis(1000); // supported as a neutral model
|
||||
|
||||
long l = "foo".length(); // supported as a neutral model
|
||||
|
||||
AtomicReference<String> ref = new AtomicReference<>(); // not supported
|
||||
ref.set("foo");
|
||||
AtomicReference<String> ref = new AtomicReference<>(); // uninteresting (parameterless constructor)
|
||||
ref.set("foo"); // supported as a summary model
|
||||
ref.toString(); // not supported
|
||||
|
||||
String.class.isAssignableFrom(Object.class); // parameter with generic type, supported as a neutral model
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
| java.time.Duration#ofMillis(long) | 1 |
|
||||
| java.util.concurrent.atomic.AtomicReference#set(Object) | 1 |
|
||||
| java.util.concurrent.atomic.AtomicReference#toString() | 1 |
|
||||
|
||||
Reference in New Issue
Block a user