Skip to content

Commit 02e93f9

Browse files
authored
Merge pull request #1309 from grails/1294
Update markDirty method implementation in DirtyCheckable
2 parents d7c213d + f72c0ab commit 02e93f9

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/dirty/checking/DirtyCheckable.groovy

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ trait DirtyCheckable {
9898
void markDirty(String propertyName, newValue) {
9999
if( $changedProperties != null && !$changedProperties.containsKey(propertyName)) {
100100
def oldValue = ((GroovyObject) this).getProperty(propertyName)
101-
boolean isNull = newValue == null
102-
if ((isNull && oldValue != null) ||
103-
(!isNull && oldValue == null) ||
104-
(!isNull && !newValue.equals(oldValue))) {
105-
$changedProperties.put propertyName, oldValue
106-
}
101+
markDirty(propertyName, newValue, oldValue)
107102
}
108103
}
109104

@@ -116,8 +111,8 @@ trait DirtyCheckable {
116111
if( $changedProperties != null && !$changedProperties.containsKey(propertyName)) {
117112
boolean isNull = newValue == null
118113
if ((isNull && oldValue != null) ||
119-
(!isNull && oldValue == null) ||
120-
(!isNull && !newValue.equals(oldValue))) {
114+
(!isNull && oldValue == null) ||
115+
(!isNull && !newValue.equals(oldValue))) {
121116
$changedProperties.put propertyName, oldValue
122117
}
123118
}
@@ -152,4 +147,4 @@ trait DirtyCheckable {
152147
return null
153148
}
154149
}
155-
}
150+
}

grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/DirtyCheckingSpec.groovy

Whitespace-only changes.

0 commit comments

Comments
 (0)