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

Properties without value should fail when iterating a domain object collection #12972

Open
melix opened this issue Apr 30, 2020 · 3 comments
Open
Labels

Comments

@melix
Copy link
Contributor

melix commented Apr 30, 2020

This is a regression which happened between 6.1 and 6.2.

Expected Behavior

When a property is added to a domain object collection, and that no value is provided for this property, iterating on the collection should fail with:

No value has been specified for this property.

(ideally it should say what property but there it has no name)

Current Behavior

Since 6.2, iterating on the collection works, the property is silently ignored, as if it wasn't added to the container. While it can be convenient, it's actually confusing.

Steps to Reproduce

Reproducer

@groovy.transform.Canonical
class Thing implements Named {
    final String name
}

def container = objects.domainObjectSet(Thing)

def provider = objects.property(Thing)

container.addLater(provider)

container.each { println it.name }

This script fails in 6.1, passes in 6.2.

@stale
Copy link

stale bot commented Apr 3, 2022

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Apr 3, 2022
@melix
Copy link
Contributor Author

melix commented Apr 4, 2022

This behavior is still present in 7.4.1.

@alllex
Copy link
Member

alllex commented Aug 24, 2022

I think it's this change that introduced different behavior:
ec66818#diff-acd0c9c9cb69fc3c944be33befdde036f5f448a58517dd1b140fb25ac9a0a225R341-R344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants