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

30 lines
388 B
Plaintext

The use of unnecessary types makes the eye stumble, and inhibits the smooth reading of code.
== Noncompliant Code Example
----
public void doSomething() {
<String>foo("blah"); // Noncompliant; <String> is inferred
}
public void <T> foo(T t) {
// ...
}
----
== Compliant Solution
----
public void doSomething() {
foo("blah");
}
public void <T> foo(T t) {
// ...
}
----