jamesfredley commented on issue #16123:
URL: https://github.com/apache/grails-core/issues/16123#issuecomment-5243005408

   ### Ecosystem impact scan
   
   To size how many published plugins are affected, I scanned the released jars 
of 17 Grails plugins for the mismatch described above: a **generic trait** 
whose Groovy 4 compiled `$Trait$FieldHelper` is **non-generic**. Any class 
compiled by Grails 8 (Groovy 5) against such a trait gets an invalid 
`Signature` attribute and throws `MalformedParameterizedTypeException` on 
`Class.getGenericInterfaces()`.
   
   Detection method per jar: locate every `*$Trait$FieldHelper.class`, `javap` 
both it and its owning trait, and flag the case `traitGeneric=true` + 
`helperGeneric=false`.
   
   The scan reproduces both of the empirical results I already had, which 
validates it:
   
   - `grails-logical-delete:3.0.0` is flagged, and it is the plugin that 
actually failed at runtime in the report above.
   - `grails-shiro:6.0.0` and `grails-quartz:4.0.1` are not flagged, and both 
loaded and worked correctly on 8.0.0-M5 in the same sweep.
   
   ### Results
   
   | Plugin | Trait | Status |
   |---|---|---|
   | `org.grails.plugins:grails-logical-delete:3.0.0` | 
`grails.logical.delete.LogicalDelete` | **AT RISK** (`traitGeneric=true`, 
`helperGeneric=false`) |
   | `org.grails.plugins:audit-logging:6.0.0` | 
`grails.plugins.orm.auditable.Stampable` | **AT RISK** (`traitGeneric=true`, 
`helperGeneric=false`) |
   | `org.grails.plugins:audit-logging:6.0.0` | 
`grails.plugins.orm.auditable.Auditable` | not generic, safe |
   | `org.grails.plugins:grails-shiro:6.0.0` | `GrailsShiroRealm`, 
`TypedNamedArgs` | not generic, safe |
   | `org.apache.grails:grails-quartz:4.0.1` | 
`grails.plugins.quartz.QuartzJob` | not generic, safe |
   | `org.grails.plugins:spring-security-core:7.0.0-M3` | `CommandLineHelper`, 
`SkipBootstrap` | not generic, safe |
   | `org.grails.plugins:database-migration:9.0.0-M3` | 3 command traits | not 
generic, safe |
   | `spring-security-rest`, `spring-security-acl`, `spring-security-ui`, 
`grails-web-console:7.1.0`, `grails-redis:5.0.1`, `grails-elasticsearch:5.1.0`, 
`mongodb:9.0.0-M3`, `grails-cache-redis:6.0.0-RC1`, `cache-ehcache:5.0.0-RC1`, 
`grails-export:7.1.0`, `asynchronous-mail:3.1.2` | - | no trait fields at all |
   
   ### Why this matters beyond logical-delete
   
   `grails.plugins.orm.auditable.Stampable` from `audit-logging` is the more 
significant hit. It is a widely used trait that applications apply directly to 
their own domain classes, so every such domain class compiled under Grails 8 
would carry the invalid signature.
   
   That failure is currently masked: `audit-logging:6.0.0` already fails 
earlier during `doWithSpring` for an unrelated reason (the 
`Holders.grailsApplication` timing issue addressed by #16101). Once that is 
resolved, this trait problem becomes the next blocker for the same plugin.
   
   ### Takeaway
   
   The condition is narrow but not rare: it needs a trait that is both 
**generic** and **carries fields**. Most plugin traits are one or the other, 
which is why the majority of the sample is unaffected. But when it does apply, 
the plugin is unusable and the error points at JDK introspection rather than at 
the plugin, so it is very hard to diagnose from the stack trace alone.
   


-- 
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