Author: hardy.ferentschik
Date: 2009-06-17 04:42:08 -0400 (Wed, 17 Jun 2009)
New Revision: 16813
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/ConstraintHelper.java
Log:
Reverted some changes. Cache should not be static
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/ConstraintHelper.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/ConstraintHelper.java 2009-06-16
20:12:49 UTC (rev 16812)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/ConstraintHelper.java 2009-06-17
08:42:08 UTC (rev 16813)
@@ -82,10 +82,13 @@
*/
public class ConstraintHelper {
- private final static Map<Class<? extends Annotation>, List<Class<?
extends ConstraintValidator<?, ?>>>> builtinConstraints =
+ private final Map<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<?, ?>>>> builtinConstraints =
new ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<?, ?>>>>();
- static {
+ private final Map<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>>
constraintValidatorDefinitons =
+ new ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>>();
+
+ public ConstraintHelper() {
List<Class<? extends ConstraintValidator<?, ?>>> constraintList =
new ArrayList<Class<? extends ConstraintValidator<?, ?>>>();
constraintList.add( AssertFalseValidator.class );
@@ -157,9 +160,6 @@
builtinConstraints.put( Size.class, constraintList );
}
- private final Map<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>>
constraintValidatorDefinitons =
- new ConcurrentHashMap<Class<? extends Annotation>, List<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>>();
-
public List<Class<? extends ConstraintValidator<? extends Annotation,
?>>> getBuiltInConstraints(Class<? extends Annotation> annotationType) {
final List<Class<? extends ConstraintValidator<?, ?>>> builtInList =
getBuiltInFromAnnotationType(
annotationType
Show replies by date