Author: epbernard
Date: 2009-02-24 10:19:02 -0500 (Tue, 24 Feb 2009)
New Revision: 16023
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintViolationImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ExecutionContext.java
Log:
BVAL-127 remove ConstraintViolation.getGroups()
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2009-02-24
14:58:57 UTC (rev 16022)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2009-02-24
15:19:02 UTC (rev 16023)
@@ -66,14 +66,6 @@
Object getInvalidValue();
/**
- * @return the list of groups that the triggered constraint applies on and which also
are
- * within the list of groups requested for validation.
- *
- * TODO: considering removal, if you think it's important, speak up
- */
- Set<Class<?>> getGroups();
-
- /**
* Constraint metadata reported to fail.
* The returned instance is immutable.
*
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-02-24
14:58:57 UTC (rev 16022)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-02-24
15:19:02 UTC (rev 16023)
@@ -22,11 +22,11 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import javax.validation.AmbiguousConstraintUsageException;
+import org.hibernate.validation.AmbiguousConstraintUsageException;
import javax.validation.ConstraintDescriptor;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorFactory;
-import javax.validation.UnexpectedTypeForConstraintException;
+import javax.validation.UnexpectedTypeException;
import javax.validation.ValidationException;
import org.slf4j.Logger;
@@ -138,7 +138,6 @@
leafBeanInstance,
value,
executionContext.peekPropertyPath(), //FIXME use error.getProperty()
- executionContext.getCurrentGroup(),
descriptor
);
constraintViolations.add( failingConstraintViolation );
@@ -187,7 +186,7 @@
private void verifyResolveWasUnique(Class valueClass, List<Class>
assignableClasses) {
if ( assignableClasses.size() == 0 ) {
- throw new UnexpectedTypeForConstraintException( "No validator could be found for
type: " + valueClass.getName() );
+ throw new UnexpectedTypeException( "No validator could be found for type: "
+ valueClass.getName() );
}
else if ( assignableClasses.size() > 1 ) {
StringBuilder builder = new StringBuilder();
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintViolationImpl.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintViolationImpl.java 2009-02-24
14:58:57 UTC (rev 16022)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintViolationImpl.java 2009-02-24
15:19:02 UTC (rev 16023)
@@ -32,7 +32,6 @@
private Class<T> beanClass;
private Object value;
private String propertyPath;
- private Set<Class<?>> groups;
private Object leafBeanInstance;
private final ConstraintDescriptor constraintDescriptor;
private String rawMessage;
@@ -40,15 +39,13 @@
public ConstraintViolationImpl(String messageTemplate, String interpolatedMessage, T
rootBean, Class<T> beanClass,
Object leafBeanInstance, Object value,
- String propertyPath, Class<?> group, ConstraintDescriptor
constraintDescriptor) {
+ String propertyPath, ConstraintDescriptor constraintDescriptor) {
this.rawMessage = messageTemplate;
this.interpolatedMessage = interpolatedMessage;
this.rootBean = rootBean;
this.beanClass = beanClass;
this.value = value;
this.propertyPath = propertyPath;
- groups = new HashSet<Class<?>>();
- groups.add( group );
this.leafBeanInstance = leafBeanInstance;
this.constraintDescriptor = constraintDescriptor;
}
@@ -89,21 +86,10 @@
return propertyPath;
}
- /**
- * {@inheritDoc}
- */
- public Set<Class<?>> getGroups() {
- return groups;
- }
-
public ConstraintDescriptor getConstraintDescriptor() {
return this.constraintDescriptor;
}
- public void addGroups(Set<Class<?>> groupSet) {
- groups.addAll( groupSet );
- }
-
@Override
public boolean equals(Object o) {
if ( this == o ) {
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ExecutionContext.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ExecutionContext.java 2009-02-24
14:58:57 UTC (rev 16022)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ExecutionContext.java 2009-02-24
15:19:02 UTC (rev 16023)
@@ -155,9 +155,6 @@
if ( i == -1 ) {
failingConstraintViolations.add( failingConstraintViolation );
}
- else {
- failingConstraintViolations.get( i ).addGroups( failingConstraintViolation.getGroups()
);
- }
}
public void addConstraintFailures(List<ConstraintViolationImpl<T>>
failingConstraintViolations) {
Show replies by date