rspec/rules/S2557/java/rule.adoc
2022-02-04 16:28:24 +00:00

41 lines
577 B
Plaintext

The use of unnecessary types makes the eye stumble, and inhibits the smooth reading of code.
== Noncompliant Code Example
[source,java]
----
public void doSomething() {
<String>foo("blah"); // Noncompliant; <String> is inferred
}
public void <T> foo(T t) {
// ...
}
----
== Compliant Solution
[source,java]
----
public void doSomething() {
foo("blah");
}
public void <T> foo(T t) {
// ...
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]