The GitHub Actions job "CI" on grails-core.git/7.0.x has succeeded.
Run started by GitHub user jdaugherty (triggered by jdaugherty).

Head commit for run:
ce2db7a52d3b7c4d9df8117801d1f64dfe6ca744 / James Daugherty 
<[email protected]>
Read a compiled parent's data binding white list from the class

A domain class or command object compiled against an already compiled parent, 
as a parent in another module, in a plugin, or in an incremental build is, now 
gets the same generated data binding white list it gets when compiled together 
with its parent. The names computed for a class are recorded on it in a new 
runtime-retained annotation, 
org.grails.web.databinding.GeneratedDatabindingWhiteList, and a subclass reads 
its parent's record instead of recomputing the parent from bytecode, which has 
no constraints closure and no transients list to read. The static caches of 
DefaultASTDatabindingHelper become node metadata, so names computed in one 
compilation never stand in for another compilation's class of the same name.

A class bound by rules gets its white list field wherever it is compiled, from 
a new global AST transformation, DatabindingWhiteListASTTransformation, that 
runs after canonicalization: a class that declares constraints or transients, 
implements Validateable, or extends a class that does or that carries a white 
list or a record. This covers a base class that is neither a domain class nor 
an action parameter, a command object compiled apart from the controller that 
binds it, a command object nested in another class, and a subclass that only 
inherits its rules; the binder reads the field alone. An instance property 
named constraints or transients is not a rule. A class that declares its white 
list itself keeps it and gets the record of it, however it is compiled with a 
subclass, so a subclass compiled against it reads the declared list. The 
parameter type of an action that another module compiled is left as it was 
compiled, with a warning when it has binding rules but no white list.

The white list no longer takes the fields a trait composes into a class, nor a 
property that holds a validation result, an 
org.springframework.validation.Errors, and GrailsWebDataBinder refuses to bind 
such a property whatever a white list names; a property type whose supertype is 
off the compile classpath is not taken for one. A setter that @Delegate adds 
for a property of the delegate is bindable only if the delegate's own white 
list has it, from source and from bytecode alike.

A compiled parent without a record is recomputed from bytecode with the 
plumbing Groovy adds, such as setMetaClass, left out, a setter Groovy generated 
following its field out of the list while a setter written by hand binds, and a 
warning, once per parent, that names the class being compiled and says to 
recompile the parent. A record member that is left out reads as empty.

At runtime, the include list of an object comes from its own class when that 
declares a white list; otherwise, for a GORM proxy, from the class of what the 
proxy handler unwraps; otherwise from the nearest superclass with a list. An 
exclude list narrows the generated list instead of setting it aside. An error 
while a proxy is unwrapped, or the list is read, reaches the caller.

Specs cover a domain class and a command object compiled against their compiled 
parent, through @Artefact and through the global injector, the warning, the 
record, traits, delegates, declared lists, the Groovy proxy factory, and the 
lazily loaded association in grails-test-examples/gorm. The data binding 
chapter describes the generated list and the warning, and the upgrade guide 
notes what changes.

Report URL: https://github.com/apache/grails-core/actions/runs/41076413581

With regards,
GitHub Actions via GitBox

Reply via email to