Add legacy SourceOrdering option#1541
Merged
elucash merged 1 commit intoimmutables:masterfrom Mar 31, 2025
Merged
Conversation
Prior to Immutables 2.7.5, the source ordering was defined be a "shallow" approach where accessors from the child class were added first, then the superclass, then the interfaces. This changed in 2.7.5, where the order became interfaces, then superclass, then child class. Issue 889 acknowledged this as a breaking change, and it has made it difficult for some clients to migrate safely to later versions. Add a new system property, org.immutables.useLegacyAccessorOrdering, that when set to true, reverts to the <=2.7.4 ordering. This should enable more clients to migrate to more recent versions safely.
Member
|
Thank you for the PR! It was extremely hard for me to look into it myself and got it right. I assume you've verified it works for the intended use case (migrating from older versions). I want to add at least some tests and planning to add |
elucash
added a commit
that referenced
this pull request
Mar 31, 2025
Author
|
Excellent, thanks for merging! This was tested against our migration use case, and we verified that it enabled the migration in most cases. We ran across issue #1540, which prevented a complete upgrade; hopefully, we can address that one, too! |
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.
Prior to Immutables 2.7.5, the source ordering was defined be a "shallow" approach where accessors from the child class were added first, then the superclass, then the interfaces. This changed in 2.7.5, where the order became interfaces, then superclass, then child class. Issue 889 acknowledged this as a breaking
change, and it has made it difficult for some clients to migrate safely to later versions.
Add a new system property,
org.immutables.useLegacyAccessorOrdering,
that when set to true, reverts to the <=2.7.4 ordering. This should enable more clients to migrate to more recent versions safely.
This should fix issue #1488