borinquenkid opened a new pull request, #16166:
URL: https://github.com/apache/grails-core/pull/16166

   ## Summary
   - Closes direct unit-spec coverage gaps in 
`org.grails.datastore.gorm.transactions.transform` and 
`org.grails.datastore.gorm.transform` left after #16148: `RollbackTransform`, 
`AbstractDatastoreMethodDecoratingTransformation`, 
`AbstractMethodDecoratingTransformation`, `AstMethodDispatchUtils`, and 
`AstPropertyResolveUtils`.
   - Writing the `AstPropertyResolveUtils` spec surfaced a real correctness 
bug: its property cache was keyed by class **name** (a `String`), so two 
distinct `ClassNode` instances sharing a name (e.g. from separate compilations 
of dynamically-generated/test classes) silently corrupted each other's cached 
property data under concurrent use. Fixed by keying the cache on `ClassNode` 
identity via a synchronized `IdentityHashMap`.
   - Extracted the duplicated applied-marker idempotency check/mark pattern 
(repeated across `AbstractGormASTTransformation`, 
`AbstractMethodDecoratingTransformation`, and 
`AbstractDatastoreMethodDecoratingTransformation`) into shared 
`isAlreadyApplied`/`markApplied` helpers.
   - Small cleanups flagged by static analysis: `equals()` calls replaced with 
`==`, an unused method parameter removed, Java 21 `instanceof` pattern 
variables replacing raw-type casts, `String#isEmpty()` over `length()==0`, 
`Class#getDeclaredConstructor().newInstance()` over the deprecated 
`Class#newInstance()`, and two stray doc/comment fixes.
   
   ## Test plan
   - [x] `./gradlew :grails-datamapping-core:test` (full module suite)
   - [x] `./gradlew :grails-datamapping-core:codeStyle 
:grails-datamapping-core:codenarcMain :grails-datamapping-core:codenarcTest`
   - [x] New specs directly verify the `AstPropertyResolveUtils` 
cache-corruption fix, including under concurrent access
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to