Skip to content

Commit 3999d33

Browse files
committed
Fix for ConcurrentModificationException. Fixes #9579
1 parent a1b548e commit 3999d33

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

grails-plugin-validation/src/main/groovy/grails/validation/Validateable.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ trait Validateable {
7171
static Map<String, ConstrainedProperty> getConstraintsMap() {
7272
if(this.constraintsMapInternal == null) {
7373
ConstraintsEvaluator evaluator = findConstraintsEvaluator()
74-
this.constraintsMapInternal = evaluator.evaluate this, defaultNullable()
74+
def evaluatedConstraints = evaluator.evaluate(this, defaultNullable())
7575

7676
if(!defaultNullable()) {
7777
def methods = this.getDeclaredMethods()
@@ -84,14 +84,15 @@ trait Validateable {
8484
if(isPropertyGetter(method)) {
8585
def propertyName = NameUtils.getPropertyNameForGetterOrSetter(method.name)
8686
if( !ignoredProperties.contains(propertyName) &&
87-
!this.constraintsMapInternal.containsKey(propertyName)) {
87+
!evaluatedConstraints.containsKey(propertyName)) {
8888
def cp = new ConstrainedProperty(this, propertyName, method.returnType)
8989
cp.applyConstraint 'nullable', false
90-
this.constraintsMapInternal.put propertyName, cp
90+
evaluatedConstraints.put propertyName, cp
9191
}
9292
}
9393
}
9494
}
95+
this.constraintsMapInternal = evaluatedConstraints
9596
}
9697
this.constraintsMapInternal
9798
}

0 commit comments

Comments
 (0)