Thread:
 Bound mismatch in Enhanced UserType tip 
 dipp0   19 Apr 2005, 08:37 
 Re: Bound mismatch in Enhanced UserType tip 
 stephan.maier   24 Apr 2005, 08:42 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: dipp0 (19 Apr 2005, 08:37) Replies: 1, Views: 40250
Subject: Bound mismatch in Enhanced UserType tip
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);".
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]