From 79b1c09b04181b6582cde887d1893437ad7b7254 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Wed, 28 Feb 2024 22:53:21 +0100 Subject: [PATCH] fix: Groovy 3.0.21 compatibility Resolve #706 --- .../mapping/mongo/engine/codecs/PersistentEntityCodec.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy index ce294b15..2d047a61 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy @@ -360,11 +360,11 @@ class PersistentEntityCodec extends BsonPersistentEntityCodec { return MongoConstants.MONGO_CLASS_FIELD } - protected void encodeEmbeddedCollectionUpdate(EntityAccess parentAccess, BsonDocument sets, Document unsets, Association association, v) { + protected void encodeEmbeddedCollectionUpdate(EntityAccess parentAccess, BsonDocument sets, Document unsets, Association association, Object v) { if(v instanceof Collection) { if((v instanceof DirtyCheckableCollection) && !((DirtyCheckableCollection)v).hasChangedSize()) { int i = 0 - for(o in v) { + for(o in (v as Collection)) { def embeddedUpdate = encodeUpdate(o, createEntityAccess(o), EncoderContext.builder().build(), true) def embeddedSets = embeddedUpdate.get(MONGO_SET_OPERATOR) if(embeddedSets != null) {