[hibernate-dev] GenericConstraintDef extends raw ConstraintDef

Hardy Ferentschik hibernate at ferentschik.de
Mon Oct 11 05:34:25 EDT 2010


Hi,

I recommend you create an issue on Jira -  
http://opensource.atlassian.com/projects/hibernate/browse/HV

Defining GenericConstraintDef as you suggest is of course correct. The  
reason for not using generics was
to avoid IDE warnings like "Unchecked call to 'constraintType(Class<A>)  
..."

I don't understand though why using the raw type should be not allowed. It  
might not be expected, but
I think it is correct.

I also don't understand why the problem is only occurring with Eclipse.  
Wouldn't eclipse use the same JDK
you are suing from the command line? Or do you have multiple JDKs  
installed?

I know there are issues compiling Validator using Open JDK -  
http://opensource.atlassian.com/projects/hibernate/browse/HV-318.
But that would imply that you are using two different JDKs.

--Hardy



On Sun, 10 Oct 2010 11:55:59 +0200, Dag Hovland <hovlanddag at gmail.com>  
wrote:

> Hi!
>
> We were wondering why
>
> org.hibernate.validator.cfg.defs.GenericConstraintDef
>
> extends the raw type ConstraintDef ? Using maven, it compiles, but in  
> Eclipse (with jdk-1.6) We get
> the following error:
>
> "Name clash: The method groups(Class<?>...) of type GenericConstraintDef  
> has the same erasure as
> groups(Class...) of type ConstraintDef but does not override it"
>
> and similar for the method "payload". The others methods give no errors.  
> We do not understand why,
> but it compiles after changing the definition to
>
> public class GenericConstraintDef<A extends Annotation>
> 			extends ConstraintDef<A>
>
> and also replacing the "Class<?>" in the argument to the method  
> "constraintType" with "Class<A>.
>
> Regards,
>
> Dag Hovland and Federico Mancini
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev




More information about the hibernate-dev mailing list