@@ -19,11 +19,11 @@ public static void main(String[] args) throws Exception {
1919 AtomicReference <String > reference = new AtomicReference <>(); // uninteresting (parameterless constructor)
2020 reference .set ( // $ sinkModelCandidate=set(Object):Argument[this]
2121 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)
2323 }
2424
2525 public static void callSupplier (Supplier <String > supplier ) {
26- supplier .get (); // $ sourceModelCandidate=get():ReturnValue
26+ supplier .get (); // not a source candidate (lambda flow)
2727 }
2828
2929 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
5252 public static int compareFiles (File f1 , File f2 ) {
5353 return f1 .compareTo ( // $ negativeSinkExample=compareTo(File):Argument[this]
5454 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)
5656 }
5757
5858 public static void FilesWalkExample (Path p , FileVisitOption o ) throws Exception {
@@ -66,6 +66,7 @@ public static void FilesWalkExample(Path p, FileVisitOption o) throws Exception
6666
6767 public static void WebSocketExample (URLConnection c ) throws Exception {
6868 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)
6970 }
7071
7172 public static void fileFilterExample (File f , FileFilter ff ) {
@@ -102,10 +103,10 @@ public static void FilesListExample(Path p) throws Exception {
102103
103104 Files .delete (
104105 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)
106107
107108 Files .deleteIfExists (
108109 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)
110111 }
111112}
0 commit comments