mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
Add test checking that inheritence is noticed even with annotations present
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import java.io.*;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
public class Test {
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE})
|
||||
@interface NotNull { }
|
||||
|
||||
public static void test() {
|
||||
|
||||
OutputStream stream = new OutputStream() {
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
OutputStream otherStream = null;
|
||||
otherStream.write(1);
|
||||
}
|
||||
@Override
|
||||
public void write(byte @NotNull [] b, int off, int len) throws IOException { // GOOD: even with the annotation @NotNull, this overrides write(byte[], int, int).
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user