Skip to content

Commit 226103b

Browse files
committed
Add local class test
1 parent f054f73 commit 226103b

File tree

1 file changed

+17
-0
lines changed
  • java/ql/test/library-tests/dataflow/stream-read

1 file changed

+17
-0
lines changed

java/ql/test/library-tests/dataflow/stream-read/A.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,21 @@ public static void testWrapCall() {
102102
sink(wrapStream(null)); // no flow
103103
sink(wrapStream(source())); // $ hasTaintFlow
104104
}
105+
106+
public static void testLocalClass() {
107+
InputStream in = source();
108+
109+
class LocalInputStream extends InputStream {
110+
@Override
111+
public int read() throws IOException {
112+
return 0;
113+
}
114+
115+
@Override
116+
public int read(byte[] b) throws IOException {
117+
return in.read(b);
118+
}
119+
}
120+
sink(new LocalInputStream()); // $ hasTaintFlow
121+
}
105122
}

0 commit comments

Comments
 (0)