Author: hardy.ferentschik
Date: 2009-06-18 10:24:56 -0400 (Thu, 18 Jun 2009)
New Revision: 16831
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/groups/GroupChainGenerator.java
Log:
Fixed an error message and made sure the right exception is thrown in case a cyclic group
depency is detected
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/groups/GroupChainGenerator.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/groups/GroupChainGenerator.java 2009-06-18
14:23:51 UTC (rev 16830)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/groups/GroupChainGenerator.java 2009-06-18
14:24:56 UTC (rev 16831)
@@ -1,4 +1,4 @@
-// $Id:$
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
@@ -24,6 +24,7 @@
import java.util.Map;
import javax.validation.GroupSequence;
import javax.validation.ValidationException;
+import javax.validation.GroupDefinitionException;
/**
* Used to determine the execution order.
@@ -41,7 +42,7 @@
for ( Class<?> clazz : groups ) {
if ( !clazz.isInterface() ) {
- throw new ValidationException( "A groups has to be an interface. " +
clazz.getName() + " is not." );
+ throw new ValidationException( "A group has to be an interface. " +
clazz.getName() + " is not." );
}
}
@@ -81,7 +82,7 @@
private List<Group> resolveSequence(Class<?> group,
List<Class<?>> processedSequences) {
if ( processedSequences.contains( group ) ) {
- throw new ValidationException( "Cyclic dependecy in groups definition" );
+ throw new GroupDefinitionException( "Cyclic dependency in groups definition"
);
}
else {
processedSequences.add( group );
Show replies by date