Skip to content

Commit a9c0fed

Browse files
author
Max Schaefer
committed
Add test showing spurious sink candidate from method overriding a method for which we have a model.
1 parent 02547d3 commit a9c0fed

File tree

1 file changed

+15
-0
lines changed
  • java/ql/automodel/test/AutomodelFrameworkModeExtraction/com/github/codeql/test

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.github.codeql.test;
2+
3+
public class MyWriter extends java.io.Writer {
4+
@Override
5+
public void write(char[] cbuf, int off, int len) { // $ sinkModelCandidate=write(char[],int,int):Argument[this] sourceModelCandidate=write(char[],int,int):Parameter[this] sourceModelCandidate=write(char[],int,int):Parameter[0] SPURIOUS: sinkModelCandidate=write(char[],int,int):Argument[0]
6+
}
7+
8+
@Override
9+
public void close() { // $ sinkModelCandidate=close():Argument[this] sourceModelCandidate=close():Parameter[this]
10+
}
11+
12+
@Override
13+
public void flush() { // $ sinkModelCandidate=flush():Argument[this] sourceModelCandidate=flush():Parameter[this]
14+
}
15+
}

0 commit comments

Comments
 (0)