Skip to content

Commit 94c5d53

Browse files
Jami CogswellJami Cogswell
authored andcommitted
add a couple more tests
1 parent 22c4d97 commit 94c5d53

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
| java.net.URL#URL(String) | 2 |
2+
| java.io.File#File(String) | 1 |
3+
| java.io.FileWriter#FileWriter(File) | 1 |
14
| java.lang.StringBuilder#append(String) | 1 |
25
| java.lang.StringBuilder#toString() | 1 |
6+
| java.net.URL#openConnection() | 1 |
7+
| java.net.URL#openStream() | 1 |
8+
| java.net.URLConnection#getInputStream() | 1 |
39
| java.util.Map#put(Object,Object) | 1 |
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
import java.time.Duration;
22
import java.util.HashMap;
33
import java.util.Map;
4+
import java.io.InputStream;
5+
import java.net.URL;
6+
import java.io.File;
7+
import java.io.FileWriter;
48

59
class SupportedExternalApis {
610
public static void main(String[] args) throws Exception {
7-
StringBuilder builder = new StringBuilder();
8-
builder.append("foo"); // supported
9-
builder.toString(); // supported
11+
StringBuilder builder = new StringBuilder(); // uninteresting (parameterless constructor)
12+
builder.append("foo"); // supported summary
13+
builder.toString(); // supported summary
1014

11-
Map<String, Object> map = new HashMap<>();
12-
map.put("foo", new Object()); // supported
15+
Map<String, Object> map = new HashMap<>(); // uninteresting (parameterless constructor)
16+
map.put("foo", new Object()); // supported summary
1317

1418
Duration d = java.time.Duration.ofMillis(1000); // not supported
19+
20+
URL github = new URL("https://www.github.com/"); // supported summary
21+
InputStream stream = github.openConnection().getInputStream(); // supported source (getInputStream), supported sink (openConnection)
22+
23+
new FileWriter(new File("foo")); // supported sink (FileWriter), supported summary (File)
24+
new URL("http://foo").openStream(); // supported sink (openStream), supported summary (URL)
1525
}
1626
}

0 commit comments

Comments
 (0)