Author: epbernard
Date: 2009-06-11 15:44:59 -0400 (Thu, 11 Jun 2009)
New Revision: 16764
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintHelper.java
Log:
HV-169 concurrency problem
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintHelper.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintHelper.java 2009-06-11
15:54:30 UTC (rev 16763)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintHelper.java 2009-06-11
19:44:59 UTC (rev 16764)
@@ -24,6 +24,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import javax.validation.Constraint;
import javax.validation.ConstraintDefinitionException;
import javax.validation.ConstraintValidator;
@@ -83,10 +84,10 @@
public class ConstraintHelper {
private final Map<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<?, ?>>>> builtinConstraints =
- new HashMap<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<?, ?>>>>();
+ new ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<?, ?>>>>();
private final Map<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>>
constraintValidatorDefinitons =
- new HashMap<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>>();
+ new ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>>();
public ConstraintHelper() {
@@ -275,7 +276,7 @@
*
* @return <code>true</code> if the annotation fulfills the above condtions,
<code>false</code> otherwise.
*/
- public boolean isConstraintAnnotation(Annotation annotation) {
+ public static boolean isConstraintAnnotation(Annotation annotation) {
Constraint constraint = annotation.annotationType()
.getAnnotation( Constraint.class );
Show replies by date