mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Add further test directly examining signature of method with problematic parameter types
This commit is contained in:
13
java/ql/test/library-tests/method-signatures/Test.java
Normal file
13
java/ql/test/library-tests/method-signatures/Test.java
Normal file
@@ -0,0 +1,13 @@
|
||||
import java.lang.annotation.*;
|
||||
|
||||
public class Test {
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE})
|
||||
@interface NotNull { }
|
||||
|
||||
class Inner { }
|
||||
|
||||
public void annotations(@NotNull byte[] b1, byte @NotNull [] b2, @NotNull String s, Class<@NotNull String> c, @NotNull Test.Inner ti, Class<? extends @NotNull String> wc, Class<String>[] classes, @NotNull byte b, @NotNull String[] sArray, String @NotNull [] sArray2) { }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
| Test.java:10:15:10:25 | annotations | annotations(byte[],byte[],java.lang.String,java.lang.Class,Test.Inner,java.lang.Class,java.lang.Class[],byte,java.lang.String[],java.lang.String[]) |
|
||||
@@ -0,0 +1,5 @@
|
||||
import java
|
||||
|
||||
from Method m
|
||||
where m.getFile().getBaseName() = "Test.java"
|
||||
select m, m.getSignature()
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.io.*;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
public class Test {
|
||||
public class InefficientOutputStreamAnnotations {
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE})
|
||||
@interface NotNull { }
|
||||
|
||||
Reference in New Issue
Block a user