...
Mixing generic and nongeneric code can produce unexpected results and exceptional conditions.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
OBJ03-J | Low | Probable | Medium | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description |
---|---|---|---|
Parasoft Jtest |
| CERT.OBJ03.AGBPT | Avoid conversions from parameterized types to raw types |
Bibliography
Item 23, "Don't Use Raw Types in New Code" | |
[Bloch 2007] |
Puzzle 88, "Raw Deal" | |
Section 8.3, "Avoid Casting by Using Generics" | |
"Heap Pollution" | |
[JLS 2015] | §4.8, "Raw Types" |
Topic 3, "Coping with Legacy" | |
Chapter 8, "Effective Generics" | |
"Principle of Indecent Exposure" | |
"Create a Checked Collection" |
...
...