Whenever generics are missing from source code in eclipse it suggests I “Infer Generic Type Arguments…”
The problem is that I don’t think “Infer Generic Type Arguments…” has ever actually inferred anything. It typically comes up with no suggestions.
What scenarios does it work for? How does it work?
There have been a few cases where it is possible to “infer” something – eclipse still comes up blank.
From Eclipse Help:
Leave unconstrained type arguments raw (rather than inferring ). If there are no constraints on the elements of e.g. ArrayList a, uncheck this box will cause Eclipse to still provide a wildcard parameter, replacing the reference with ArrayList.
You can find an example at the end of the page.
HTH