Commit aadc3ff
committed
VariableScopeVisitor / @slf4j workaround audit - keep what is needed, drop the rest
LoggingTransformer.java: Restored the original (Grails 2.0 era) comment. The post-Groovy-5 commit only swapped out the comment - the actual code (manual log field injection) has been the same since 2012. There is no Groovy 5 difference here.
GrailsASTUtils.java / AstUtils.groovy / AbstractMethodDecoratingTransformation.groovy: tested locally by reverting all four try/catch + non-null-VariableScope guards. Compilation of grails-datamapping-tck fails with BUG! exception in phase 'canonicalization' in source unit 'DataServiceRoutingProductDataService.groovy' unexpected NullPointerException on Groovy 5.0.6-SNAPSHOT, so the guards ARE needed. Restored them with a comment that points at the upstream bug (Groovy 5 VariableScopeVisitor NPE on certain Grails AST transformation outputs) and away from the incorrect 'Groovy 5 changed how VariableScopeVisitor handles certain AST states' framing - we have no evidence the visitor itself changed; what changed is that some Grails AST transforms now produce a node shape that the visitor fails on.
Net effect: zero functional change vs HEAD, but every comment now reflects what the audit verified rather than the original misdiagnoses. The four try/catch sites in compiler/AST code are flagged as upstream-Groovy-bug-bandaids that should be removed once the upstream fix lands.
Assisted-by: claude-code:claude-opus-4-71 parent 44ee59f commit aadc3ff
4 files changed
Lines changed: 20 additions & 31 deletions
File tree
- grails-core/src/main/groovy/org/grails/compiler/injection
- grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/transform
- grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/reflect
- grails-logging/src/main/groovy/org/grails/compiler/logging
Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
| 1510 | + | |
| 1511 | + | |
1516 | 1512 | | |
1517 | 1513 | | |
1518 | 1514 | | |
| |||
1521 | 1517 | | |
1522 | 1518 | | |
1523 | 1519 | | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
| 1520 | + | |
| 1521 | + | |
1528 | 1522 | | |
1529 | 1523 | | |
1530 | 1524 | | |
| |||
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | | - | |
| 300 | + | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
360 | | - | |
| 358 | + | |
| 359 | + | |
361 | 360 | | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
365 | | - | |
366 | | - | |
| 364 | + | |
| 365 | + | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
| |||
Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 262 | + | |
| 263 | + | |
266 | 264 | | |
267 | 265 | | |
268 | 266 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 83 | + | |
| 84 | + | |
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
| |||
0 commit comments