rspec/rules/S3677/java/rule.adoc

32 lines
558 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) {
//...
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::highlighting.adoc[]
endif::env-github,rspecator-view[]