@@ -19,11 +19,11 @@ public static void main(String[] args) throws Exception {
19
19
AtomicReference <String > reference = new AtomicReference <>(); // uninteresting (parameterless constructor)
20
20
reference .set ( // $ sinkModelCandidate=set(Object):Argument[this]
21
21
args [0 ] // $ negativeSinkExample=set(Object):Argument[0] // modeled as a flow step
22
- ); // $ negativeSourceExample=set(Object):ReturnValue // return type is void
22
+ ); // not a source candidate ( return type is void)
23
23
}
24
24
25
25
public static void callSupplier (Supplier <String > supplier ) {
26
- supplier .get (); // $ sourceModelCandidate=get():ReturnValue
26
+ supplier .get (); // not a source candidate (lambda flow)
27
27
}
28
28
29
29
public static void copyFiles (Path source , Path target , CopyOption option ) throws Exception {
@@ -52,7 +52,7 @@ public static InputStream getInputStream(String openPath, String otherPath) thro
52
52
public static int compareFiles (File f1 , File f2 ) {
53
53
return f1 .compareTo ( // $ negativeSinkExample=compareTo(File):Argument[this]
54
54
f2 // $ negativeSinkExample=compareTo(File):Argument[0] // modeled as not a sink
55
- ); // $ negativeSourceExample=compareTo(File):ReturnValue // return type is int
55
+ ); // not a source candidate ( return type is int)
56
56
}
57
57
58
58
public static void FilesWalkExample (Path p , FileVisitOption o ) throws Exception {
@@ -66,6 +66,7 @@ public static void FilesWalkExample(Path p, FileVisitOption o) throws Exception
66
66
67
67
public static void WebSocketExample (URLConnection c ) throws Exception {
68
68
c .getInputStream (); // $ sinkModelCandidate=getInputStream():Argument[this] positiveSourceExample=getInputStream():ReturnValue(remote) // not a source candidate (manual modeling)
69
+ c .connect (); // $ sinkModelCandidate=connect():Argument[this] // not a source candidate (return type is void)
69
70
}
70
71
71
72
public static void fileFilterExample (File f , FileFilter ff ) {
@@ -102,10 +103,10 @@ public static void FilesListExample(Path p) throws Exception {
102
103
103
104
Files .delete (
104
105
p // $ sinkModelCandidate=delete(Path):Argument[0] positiveSinkExample=delete(Path):Argument[0](path-injection)
105
- ); // $ negativeSourceExample=delete(Path):ReturnValue // return type is void
106
+ ); // not a source candidate ( return type is void)
106
107
107
108
Files .deleteIfExists (
108
109
p // $ sinkModelCandidate=deleteIfExists(Path):Argument[0] positiveSinkExample=deleteIfExists(Path):Argument[0](path-injection)
109
- ); // $ negativeSourceExample=deleteIfExists(Path):ReturnValue // return type is boolean
110
+ ); // not a source candidate ( return type is boolean)
110
111
}
111
112
}
0 commit comments