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

Kotlin + GIZMO should be compatible #583

Open
ge0ffrey opened this issue Jan 23, 2024 · 0 comments
Open

Kotlin + GIZMO should be compatible #583

ge0ffrey opened this issue Jan 23, 2024 · 0 comments
Labels
bug Something isn't working kotlin

Comments

@ge0ffrey
Copy link
Contributor

From #531:

@PlanningSolution
class MySolution {
    @get:PlanningEntityCollectionProperty
    var itemList: List<Item> = listOf()
    ...

I get the error

Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalStateException: Member (itemList) of class (com.acme.model.MySolution) is not public and domainAccessType is GIZMO. Maybe put the annotations onto the public getter of the field. Maybe use domainAccessType REFLECTION instead of GIZMO. [in thread "main"]

which is irritating, because the annotation is on the getter, as it explicitly has the Kotlin prefix get:.

But you're right: This isn't an issue with Gizmo itself, it originates in Timefold.
I didn't put much thought to it at the time, but instead went for the public fields approach, as it only affected a few properties in my model.
It seems that GizmoSolutionOrEntityDescriptor creates a GizmoMemberDescriptor for both the getters and the fields, and when iterating over them, it fails at the first field because Modifier.isPublic() returns false.

@ge0ffrey ge0ffrey added bug Something isn't working process/needs triage Requires initial assessment of validity, priority etc. kotlin labels Jan 23, 2024
@triceo triceo removed the process/needs triage Requires initial assessment of validity, priority etc. label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kotlin
Projects
None yet
Development

No branches or pull requests

2 participants