In Eclipse 3.1M6 (compared to M5), you get a bound mismatch error when
using the "Class<Enum> enumClass" as argument to the "Enum.valueOf()"
method.
"Bound mismatch: The generic method valueOf(Class<T>, String) of type
Enum<E> is not applicable for the arguments (Class<Enum>, String) since
the type Enum is not a valid substitute for the bounded parameter <T
extends Enum<T>>"
Workaround: Declare the variable "Class enumClass" instead to avoid the
error. There's still some warnings but at least it compiles. Also change
the line "enumClass = (Class<Enum>) Class.forName(enumClassName);" to
"enumClass = Class.forName(enumClassName);". |