Skip to content

Commit 1bc222e

Browse files
author
Stephan Brandauer
committed
Java: tests for automodel application mode positive example extraction
1 parent 2e89a11 commit 1bc222e

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| 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 |
2+
| 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 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Telemetry/AutomodelApplicationModeExtractPositiveExamples.ql
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.github.codeql.test;
2+
3+
import java.nio.file.CopyOption;
4+
import java.nio.file.Files;
5+
import java.nio.file.Path;
6+
import java.nio.file.Paths;
7+
import java.util.concurrent.atomic.AtomicReference;
8+
import java.util.function.Supplier;
9+
10+
class AutomodelApplicationModeExtractPositiveExamples {
11+
public static void callSupplier(Supplier<String> supplier) {
12+
supplier.get(); // not an example
13+
}
14+
15+
public static void copyFiles(Path source, Path target, CopyOption option) throws Exception {
16+
Files.copy(
17+
source, // positive example
18+
target, // positive example
19+
option // no example
20+
);
21+
}
22+
}

0 commit comments

Comments
 (0)