2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2020-06-30 12:48:07 +02:00
|
|
|
A method or class with too many type parameters has likely aggregated too many responsibilities and should be split.
|
|
|
|
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Noncompliant code example
|
2020-06-30 12:48:07 +02:00
|
|
|
|
|
|
|
With the default parameter value of 2:
|
2020-06-30 14:49:38 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,text]
|
2020-06-30 12:48:07 +02:00
|
|
|
----
|
|
|
|
<S, T, U, V> void foo() {} // Noncompliant; not really readable
|
|
|
|
<String, Integer, Object, String>foo(); // especially on invocations
|
|
|
|
----
|
|
|
|
|