The GitHub Actions job "Groovy Snapshot Canary Build" on grails-core.git/fix/16294-16295-non-public-bean-marshalling has succeeded. Run started by GitHub user sbglasius (triggered by sbglasius).
Head commit for run: dbbfdb538dac189233d91f79f7ae379c53675b25 / Søren Berg Glasius <[email protected]> Fix marshalling of non-public classes and Serializable beans Marshalling `someObject as JSON` (or `as XML`) failed for two common shapes of object. A class that is not public — anonymous, local or package-private — cannot have its read methods invoked reflectively from another package, even though the methods themselves are public. All four bean marshallers called `readMethod.invoke(...)` bare, so handing `as JSON` an anonymous implementation of a public interface (the usual shape of a Spring Security `UserDetails`) blew up with an `IllegalAccessException`. The read method is now resolved to the interface method where one exists and made accessible otherwise. The public field loops of both `GroovyBeanMarshaller`s failed the same way and are now made accessible too. `GenericJavaBeanMarshaller` evaluated `field.canAccess(o)` before the static check, and `canAccess` throws `IllegalArgumentException` for a static member when the object is non-null. Any bean declaring `private static final long serialVersionUID` — nearly every Serializable bean — therefore failed. The modifier checks now run first so they short-circuit. Groovy compiles the variables captured by an anonymous class into public synthetic `Reference` fields. Now that the field loops can read them, they were emitted as duplicate keys with empty-object values, so synthetic fields are skipped in all four marshallers. Fixes #16294 Fixes #16295 Report URL: https://github.com/apache/grails-core/actions/runs/33646322049 With regards, GitHub Actions via GitBox
