rspec/rules/S3677/java/rule.adoc
2021-04-28 18:08:03 +02:00

21 lines
367 B
Plaintext

Using a type parameter when you don't have to simply obfuscates the code. Qualifying an inner type with a type parameter will compile, but confuse maintainers.
== Noncompliant Code Example
----
<T extends Map> T doTheThing(T.Entry type) { // Noncompliant
//...
}
----
== Compliant Solution
----
<T extends Map> T doTheThing(Map.Entry type) {
//...
}
----