When you use <? extends MyClass>, the specific class replacing the generic must pass the is-a MyClass test. In your specific case, String is-a String. Since String can't be subclassed, the list in question must always be a list of String. So technically it's legal java, just really bad coding style.
Joined: Nov 12, 2008
I thought the compiler should check that the class is not final but that's obviously not the case.