Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Property/ConfigurableFileCollection with Groovy in BeanDynamicObject when only getter exists #25732

Closed
asodja opened this issue Jul 12, 2023 · 0 comments · Fixed by #25770
Assignees
Labels
a:bug in:groovy-dsl p:lazy-migration Issues covered by migration to an all-lazy API
Milestone

Comments

@asodja
Copy link
Member

asodja commented Jul 12, 2023

It seems it some cases we don't handle Property type correctly. See a reproducer:
#25718

We should probably do a better job when only getter exists. See the code here:

if (metaBeanProperty.getSetter() == null) {
if (metaBeanProperty.getField() == null) {
throw setReadOnlyProperty(name);
}
value = propertySetTransformer.transformValue(metaBeanProperty.getField().getType(), value);
metaBeanProperty.getField().setProperty(bean, value);

@asodja asodja changed the title Handle Property/ConfigurableFileCollection with Groovy in BeanDynamicObject when only getter exist Handle Property/ConfigurableFileCollection with Groovy in BeanDynamicObject when only getter exists Jul 12, 2023
@asodja asodja added @execution p:lazy-migration Issues covered by migration to an all-lazy API in:groovy-dsl and removed to-triage labels Jul 12, 2023
@asodja asodja self-assigned this Jul 19, 2023
@ov7a ov7a added the a:bug label Aug 10, 2023
bot-gradle added a commit that referenced this issue Aug 22, 2023
…edDomainObjectContainer

When NamedDomainObjectContainer is used, then Groovy lazy property assignment cannot be used, since we don't handle `Property` types in `BeanDynamicObject` when a property has only getter.

Fixes #25732

Co-authored-by: Anže Sodja <asodja@gradle.com>
@bot-gradle bot-gradle added this to the 8.4 RC1 milestone Aug 22, 2023
@ov7a ov7a removed the to-triage label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug in:groovy-dsl p:lazy-migration Issues covered by migration to an all-lazy API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants