Java: tests for automodel application mode negative example extraction

This commit is contained in:
Stephan Brandauer
2023-07-21 17:04:56 +02:00
parent abed936556
commit 938a7a788f
3 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
| Test.java:7:10:7:19 | ByteBuffer | class qualifier\nrelated locations: $@.\nmetadata: $@, $@, $@, $@, $@, $@. | Test.java:7:10:8:19 | allocate(...) | CallContext | file://java.nio:1:1:1:1 | java.nio | package | file://ByteBuffer:1:1:1:1 | ByteBuffer | type | file://false:1:1:1:1 | false | subtypes | file://allocate:1:1:1:1 | allocate | name | file://(int):1:1:1:1 | (int) | signature | file://Argument[this]:1:1:1:1 | Argument[this] | input |
| Test.java:8:15:8:18 | size | external\nrelated locations: $@.\nmetadata: $@, $@, $@, $@, $@, $@. | Test.java:7:10:8:19 | allocate(...) | CallContext | file://java.nio:1:1:1:1 | java.nio | package | file://ByteBuffer:1:1:1:1 | ByteBuffer | type | file://false:1:1:1:1 | false | subtypes | file://allocate:1:1:1:1 | allocate | name | file://(int):1:1:1:1 | (int) | signature | file://Argument[0]:1:1:1:1 | Argument[0] | input |

View File

@@ -0,0 +1 @@
Telemetry/AutomodelApplicationModeExtractNegativeExamples.ql

View File

@@ -0,0 +1,10 @@
package com.github.codeql.test;
import java.nio.ByteBuffer;
class AutomodelApplicationModeExtractNegativeExamples {
public static ByteBuffer getBuffer(int size) {
return ByteBuffer // negative example, modeled as a neutral model
.allocate(size); // negative example, modeled as a neutral model
}
}