mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Java: tests for automodel application mode positive example extraction
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
| Test.java:17:4:17:9 | source | path-injection\nrelated locations: $@.\nmetadata: $@, $@, $@, $@, $@, $@. | Test.java:16:3:20:3 | copy(...) | CallContext | file://java.nio.file:1:1:1:1 | java.nio.file | package | file://Files:1:1:1:1 | Files | type | file://false:1:1:1:1 | false | subtypes | file://copy:1:1:1:1 | copy | name | file://(Path,Path,CopyOption[]):1:1:1:1 | (Path,Path,CopyOption[]) | signature | file://Argument[0]:1:1:1:1 | Argument[0] | input |
|
||||
| Test.java:18:4:18:9 | target | path-injection\nrelated locations: $@.\nmetadata: $@, $@, $@, $@, $@, $@. | Test.java:16:3:20:3 | copy(...) | CallContext | file://java.nio.file:1:1:1:1 | java.nio.file | package | file://Files:1:1:1:1 | Files | type | file://false:1:1:1:1 | false | subtypes | file://copy:1:1:1:1 | copy | name | file://(Path,Path,CopyOption[]):1:1:1:1 | (Path,Path,CopyOption[]) | signature | file://Argument[1]:1:1:1:1 | Argument[1] | input |
|
||||
@@ -0,0 +1 @@
|
||||
Telemetry/AutomodelApplicationModeExtractPositiveExamples.ql
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.github.codeql.test;
|
||||
|
||||
import java.nio.file.CopyOption;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class AutomodelApplicationModeExtractPositiveExamples {
|
||||
public static void callSupplier(Supplier<String> supplier) {
|
||||
supplier.get(); // not an example
|
||||
}
|
||||
|
||||
public static void copyFiles(Path source, Path target, CopyOption option) throws Exception {
|
||||
Files.copy(
|
||||
source, // positive example
|
||||
target, // positive example
|
||||
option // no example
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user