mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Do not consider expressions as candidates whose type is annotated with @FunctionalInterface.
This commit is contained in:
@@ -9,6 +9,7 @@ import java.nio.file.Paths;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.nio.file.FileVisitOption;
|
||||
import java.net.URLConnection;
|
||||
import java.util.concurrent.FutureTask;
|
||||
@@ -22,7 +23,7 @@ class Test {
|
||||
}
|
||||
|
||||
public static void callSupplier(Supplier<String> supplier) {
|
||||
supplier.get(); // $ sourceModelCandidate=get():ReturnValue sinkModelCandidate=get():Argument[this]
|
||||
supplier.get(); // $ sourceModelCandidate=get():ReturnValue
|
||||
}
|
||||
|
||||
public static void copyFiles(Path source, Path target, CopyOption option) throws Exception {
|
||||
@@ -65,6 +66,12 @@ class Test {
|
||||
public static void WebSocketExample(URLConnection c) throws Exception {
|
||||
c.getInputStream(); // $ sinkModelCandidate=getInputStream():Argument[this] positiveSourceExample=getInputStream():ReturnValue(remote) // not a source candidate (manual modeling)
|
||||
}
|
||||
|
||||
public static void fileFilterExample(File f, FileFilter ff) {
|
||||
f.listFiles( // $ sinkModelCandidate=listFiles(FileFilter):Argument[this]
|
||||
ff
|
||||
); // $ sourceModelCandidate=listFiles(FileFilter):ReturnValue
|
||||
}
|
||||
}
|
||||
|
||||
class OverrideTest extends Exception {
|
||||
|
||||
Reference in New Issue
Block a user