I have the following test class that uses generics to overload a method. It works when compiled with javac and fails to compile in Eclipse Helios. My java version is 1.6.0_2
A point to keep in mind is that (all?, certainly some as for instance the NetBeans editor does this) static code analysis tools do not consider return type or modifiers (private/public etc.) as part of the method signature.
If that is the case, then with the aid of type erasure both getFirst
methods would get the signature getFirst(java.util.ArrayList)
and hence trigger a name clash...