Failing to use bounded wildcards ("? extends T" or "? super T") can reduce the usefulness of generic classes and force clients to develop clumsy workarounds to use such classes. Bounded wildcards improve code flexibility, but are often not used because they are perceived as unnecessary.
Noncompliant Code Example
TODO
Code Block | ||
---|---|---|
| ||
TODO
|
Compliant Solution
TODO
Code Block | ||
---|---|---|
| ||
TODO
|
Risk Assessment
TODO
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MSC10-J | — | — | — | --- | --- |
Automated Detection
TODO
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
References
TODO