fix: Use field getters/setters when available, enforce getters/setters are public#2072
Draft
Christopher-Chianelli wants to merge 2 commits intoTimefoldAI:mainfrom
Draft
fix: Use field getters/setters when available, enforce getters/setters are public#2072Christopher-Chianelli wants to merge 2 commits intoTimefoldAI:mainfrom
Christopher-Chianelli wants to merge 2 commits intoTimefoldAI:mainfrom
Conversation
triceo
reviewed
Feb 4, 2026
Collaborator
There was a problem hiding this comment.
I like this!
We need to figure out what to do with Gizmo. Personally, I'd just remove Gizmo from core, I don't see much point. It's not being used, and it complicates the codebase.
That said, I'm open to keeping Gizmo in core, if we can make it the default without changing any of the rules we just defined. In that case, it would only have benefits and therefore reflection-based access could be removed entirely.
Side note: there seem to be failing tests.
…s are public Before, this is how domain accessors were created: - Annotation on the field? Make that field accessible and read/write directly to it. - Annotation on a getter method? Make that method accessible, and pair it with the corresponding setter (if available) and read/write using the method pair. Now, domain accessors are created like this: - Annotation on the field? If the field has a getter, enforce that getter is public. If that field is not final, also enforce there is a public setter for the field. If there is a setter but no getter, also fail. Use the field getter/setter for the MemberAccessor; only directly read/write the field if the field is public and there are no getters or setters for the field. Fail-fast otherwise. - Annotation on a getter method? Enforce the getter is public, and pair it with the corresponding setter (if available, fail if there a setter and not public), and read/write using the method pair. Quarkus generated MemberAccessors will also follow these same rules and use getters/setters if available. This is a breaking change. Fixes TimefoldAI#1862 and TimefoldAI#1710.
Additionally, the code for GIZMO to use getters/setters is now done in core.
99b624a to
3be2031
Compare
Contributor
Author
|
Gizmo in core was modified to use getters/setters for fields if available. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Before, this is how domain accessors were created:
Now, domain accessors are created like this:
Quarkus generated MemberAccessors will also follow these same rules and use getters/setters if available.
This is a breaking change. Do not merge until 2.0 is branched.
Fixes #1862 and #1710.