I recently switched from JDK1.6 to JDK 1.7.
I have this code:
SomeClass<SomeType> someVariable = new SomeClass<SomeType>(createSomeObject());
Now I get a warning:
Redundant specification of type arguments <SomeType>
If I use a quick fix, Eclipse gives me the following:
SomeClass<SomeType> someVariable = new SomeClass<>(createSomeObject());
The result is
Got an exception - expecting EOF, found 'xyz'
xyz is the next element in the code.
When I remove the angle brackets, I get this warning:
SomeClass is a raw type. References to generic type SomeClass<M> should be parameterized
If I add a type parameter, I get the first warning (redundant specification ...)
WTF going on?
I want to keep both warnings, and I'm still using Eclipse 3.7.1. I do not want to update Eclipse if there is another way to solve this problem, since it will take me some time to configure it the way I want it again.
source
share