Add further test directly examining signature of method with problematic parameter types

This commit is contained in:
Chris Smowton
2022-01-27 16:19:51 +00:00
parent 379f2438a6
commit b1c98ae3c2
4 changed files with 20 additions and 1 deletions

View 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) { }
}

View File

@@ -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[]) |

View File

@@ -0,0 +1,5 @@
import java
from Method m
where m.getFile().getBaseName() = "Test.java"
select m, m.getSignature()

View File

@@ -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 { }