rspec/rules/S3681/java/rule.adoc

24 lines
402 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Using a type parameter when you don't have to simply obfuscates the code. Inserting an unnecessary type parameter in an unparameterized method call will compile, but confuse maintainers.
== Noncompliant Code Example
----
void doTheThing() {
// ...
}
//...
this.<String>doTheThing(); // Noncompliant
----
== Compliant Solution
----
void doTheThing() {
// ...
}
//...
this.doTheThing();
----