Skip to content

Commit 6deeb36

Browse files
committed
Java: Update the comments in SupportedExternalApis to include the neutral kind and add a sink neutral example.
1 parent 71a36fc commit 6deeb36

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ public static void main(String[] args) throws Exception {
1717
map.put("foo", new Object()); // supported summary
1818
map.entrySet().iterator().next().getKey(); // nested class (Map.Entry), supported summaries (entrySet, iterator, next, getKey)
1919

20-
Duration d = java.time.Duration.ofMillis(1000); // supported neutral
20+
Duration d = java.time.Duration.ofMillis(1000); // supported neutral summary
2121

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

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

28-
FileUtils.deleteDirectory(new File("foo")); // supported neutral (deleteDirectory), supported summary (File)
28+
File file = new File("foo"); // supported summary (File)
29+
FileUtils.deleteDirectory(file); // supported neutral summary (deleteDirectory)
30+
31+
file.compareTo(file); // supported neutral sink (compareTo)
2932
}
3033
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ 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); // supported as a neutral model
14+
Duration d = java.time.Duration.ofMillis(1000); // supported as a neutral summary model
1515

16-
long l = "foo".length(); // supported as a neutral model
16+
long l = "foo".length(); // supported as a neutral summary model
1717

1818
AtomicReference<String> ref = new AtomicReference<>(); // uninteresting (parameterless constructor)
1919
ref.set("foo"); // supported as a summary model
2020
ref.toString(); // not supported
2121

22-
String.class.isAssignableFrom(Object.class); // parameter with generic type, supported as a neutral model
22+
String.class.isAssignableFrom(Object.class); // parameter with generic type, supported as a neutral summary model
2323

2424
System.out.println(d);
2525
System.out.println(map);

0 commit comments

Comments
 (0)