Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: REM cost reform

...

Even when heap pollution occurs, the variable is still guaranteed to refer to a subclass or subinterface of the declared type but is not guaranteed to always refer to a subtype of its declared type. In this example, list does not refer to a subtype of its declared type (List<String>) but only to the subinterface of the declared type (List).

Compliant Solution (Parameterized Collection)

...

Mixing generic and nongeneric code can produce unexpected results and exceptional conditions.

Rule

Severity

Likelihood

Detectable

RepairableRemediation Cost

Priority

Level

OBJ03-J

Low

Probable

Yes

NoMedium

P4

L3

Automated Detection

ToolVersionCheckerDescription
Parasoft Jtest
Include Page
Parasoft_V
Parasoft_V
CERT.OBJ03.AGBPTAvoid conversions from parameterized types to raw types

...