You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "borinquenkid (via GitHub)" <gi...@apache.org> on 2026/08/18 17:56:00 UTC

[PR] Add specs and clean up transactions.transform/transform in grails-datamapping-core [grails-core]

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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add specs and clean up transactions.transform/transform in grails-datamapping-core [grails-core]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16166:
URL: https://github.com/apache/grails-core/pull/16166#issuecomment-5332597545

   ## [Codecov](https://app.codecov.io/gh/apache/grails-core/pull/16166?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `82.85714%` with `6 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 53.4265%. Comparing base ([`75cd618`](https://app.codecov.io/gh/apache/grails-core/commit/75cd61800df1087e131d2fe18156d13af79417f5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1720abd`](https://app.codecov.io/gh/apache/grails-core/commit/1720abd7117ef96c4703819792bff37ee8a11da4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16166?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...astore/gorm/transform/AstPropertyResolveUtils.java](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAstPropertyResolveUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0FzdFByb3BlcnR5UmVzb2x2ZVV0aWxzLmphdmE=) | 80.9524% | [0 Missing and 4 partials :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...orm/transform/AbstractGormASTTransformation.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAbstractGormASTTransformation.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0Fic3RyYWN0R29ybUFTVFRyYW5zZm9ybWF0aW9uLmdyb292eQ==) | 85.7143% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...form/AbstractMethodDecoratingTransformation.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAbstractMethodDecoratingTransformation.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0Fic3RyYWN0TWV0aG9kRGVjb3JhdGluZ1RyYW5zZm9ybWF0aW9uLmdyb292eQ==) | 50.0000% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/grails-core/pull/16166/graphs/tree.svg?width=650&height=150&src=pr&token=qJrryhpk7u&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##                8.1.x     #16166        +/-   ##
   ==================================================
   + Coverage     53.4149%   53.4265%   +0.0116%     
   - Complexity      19459      19469        +10     
   ==================================================
     Files            2081       2081                
     Lines           98993      98994         +1     
     Branches        17361      17359         -2     
   ==================================================
   + Hits            52877      52889        +12     
   + Misses          38566      38560         -6     
   + Partials         7550       7545         -5     
   ```
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16166?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...ansactions/transform/TransactionalTransform.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransactions%2Ftransform%2FTransactionalTransform.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNhY3Rpb25zL3RyYW5zZm9ybS9UcmFuc2FjdGlvbmFsVHJhbnNmb3JtLmdyb292eQ==) | `92.5000% <100.0000%> (ø)` | |
   | [...ractDatastoreMethodDecoratingTransformation.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAbstractDatastoreMethodDecoratingTransformation.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0Fic3RyYWN0RGF0YXN0b3JlTWV0aG9kRGVjb3JhdGluZ1RyYW5zZm9ybWF0aW9uLmdyb292eQ==) | `92.2078% <100.0000%> (+2.4642%)` | :arrow_up: |
   | [.../AbstractTraitApplyingGormASTTransformation.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAbstractTraitApplyingGormASTTransformation.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0Fic3RyYWN0VHJhaXRBcHBseWluZ0dvcm1BU1RUcmFuc2Zvcm1hdGlvbi5ncm9vdnk=) | `88.0952% <ø> (ø)` | |
   | [...re/gorm/transform/OrderedGormTransformation.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FOrderedGormTransformation.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL09yZGVyZWRHb3JtVHJhbnNmb3JtYXRpb24uZ3Jvb3Z5) | `88.8889% <100.0000%> (ø)` | |
   | [...orm/transform/AbstractGormASTTransformation.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAbstractGormASTTransformation.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0Fic3RyYWN0R29ybUFTVFRyYW5zZm9ybWF0aW9uLmdyb292eQ==) | `83.3333% <85.7143%> (+4.7619%)` | :arrow_up: |
   | [...form/AbstractMethodDecoratingTransformation.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAbstractMethodDecoratingTransformation.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0Fic3RyYWN0TWV0aG9kRGVjb3JhdGluZ1RyYW5zZm9ybWF0aW9uLmdyb292eQ==) | `91.9355% <50.0000%> (+2.3355%)` | :arrow_up: |
   | [...astore/gorm/transform/AstPropertyResolveUtils.java](https://app.codecov.io/gh/apache/grails-core/pull/16166?src=pr&el=tree&filepath=grails-datamapping-core%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fdatastore%2Fgorm%2Ftransform%2FAstPropertyResolveUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFtYXBwaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L29yZy9ncmFpbHMvZGF0YXN0b3JlL2dvcm0vdHJhbnNmb3JtL0FzdFByb3BlcnR5UmVzb2x2ZVV0aWxzLmphdmE=) | `80.7229% <80.9524%> (-1.4200%)` | :arrow_down: |
   
   ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/apache/grails-core/pull/16166/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add specs and clean up transactions.transform/transform in grails-datamapping-core [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty merged PR #16166:
URL: https://github.com/apache/grails-core/pull/16166


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add specs and clean up transactions.transform/transform in grails-datamapping-core [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16166:
URL: https://github.com/apache/grails-core/pull/16166#issuecomment-5333114892

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 1720abd7117ef96c4703819792bff37ee8a11da4
   ▶️ Tests:  63691 executed
   ⚪️ Checks: 77/77 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org