typetools / typetools/checker-framework
TaintedChecker false positive with Vector<Object> and .copyInto
@wmdietl is already working on this.
Since May 16, 2019.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Using TaintingChecker (i.e. 2.8.0) on code below reports a false positive for the copyInto call.
import java.util.Vector;
public class SHUTest1 {
public static void main(String[] args) {
Vector<Object> vector = new Vector<Object>(0);
SHUTest1 objectListData[] = new SHUTest1[vector.size()];
vector.copyInto(objectListData);
}
}
[jsr308.javac] /home/huehner/ob/branches/pi_checker_pg/src/SHUTest1.java:8: error: [vector.copyinto.type.incompatible] incompatible component type in Vector.copyinto.
[jsr308.javac] vector.copyInto(objectListData);
[jsr308.javac] ^
[jsr308.javac] found : @Tainted Object
[jsr308.javac] required: @Tainted SHUTest1
Note that his only happens when the Vector is typed as 'Vector' intead of type matching the argument of copyInto.
While using here does not make any sense can be found in the wild of big / old-codebase.
Note: This could be related / duplicate of either #104 or #660 based on their descriptions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.