Let say I have a java class called Input with a Generic for its type T
class Input<T>
And I have a class Work that have a list of inputs
And this class wants o return its list of input, each of them may be of different type
If I declare it as:
Collection<Input<?>> inputs ();
With this declaration Sonar will complain of the method returning wildcard type.
If I remove the wildcard it will complain of using the interface without specifying the generics.
As I do have almost all rules activated, if using the @SupressWarnings it will also complain about it.
I'd rather prefer a more properly design solution than using a // NOSONAR or any other method to avoid the warning.
I have seen a lot of articles similar to this one but none so specific or with a viable solution.
Any ideas?