mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
add a couple more tests
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
| java.net.URL#URL(String) | 2 |
|
||||
| java.io.File#File(String) | 1 |
|
||||
| java.io.FileWriter#FileWriter(File) | 1 |
|
||||
| java.lang.StringBuilder#append(String) | 1 |
|
||||
| java.lang.StringBuilder#toString() | 1 |
|
||||
| java.net.URL#openConnection() | 1 |
|
||||
| java.net.URL#openStream() | 1 |
|
||||
| java.net.URLConnection#getInputStream() | 1 |
|
||||
| java.util.Map#put(Object,Object) | 1 |
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
|
||||
class SupportedExternalApis {
|
||||
public static void main(String[] args) throws Exception {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("foo"); // supported
|
||||
builder.toString(); // supported
|
||||
StringBuilder builder = new StringBuilder(); // uninteresting (parameterless constructor)
|
||||
builder.append("foo"); // supported summary
|
||||
builder.toString(); // supported summary
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("foo", new Object()); // supported
|
||||
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
|
||||
|
||||
URL github = new URL("https://www.github.com/"); // supported summary
|
||||
InputStream stream = github.openConnection().getInputStream(); // supported source (getInputStream), supported sink (openConnection)
|
||||
|
||||
new FileWriter(new File("foo")); // supported sink (FileWriter), supported summary (File)
|
||||
new URL("http://foo").openStream(); // supported sink (openStream), supported summary (URL)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user