-
Notifications
You must be signed in to change notification settings - Fork 18
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
Revert unnecessary breaking change to Item::equals #621
Conversation
I'd suggest to split this up into the uncontroversial changes to release notes and the added tests on the one hand and the changes to EntityDocument on the other hand. Pinging @brightbyte as I remember he had arguments against making EntityDocument extend Comparable. |
I personally don't really bother as long as we have equals in some way on EntityDocument. |
I can split this, but please note that this reverts the controversial change in #615. |
868c750
to
9e8868c
Compare
Rebased. |
+1. I'm fine with either approach. The old one clearly did not cause real issues, and I don't see the new one causing them either. Sure, each of them has its own little advantage, though arguing over this seems hardly worth peoples time. |
This is approaching the "problem" (if it ever was a problem, in two years I have never heard of it causing any problems) from the wrong side. The correct way is to deprecate the interface in DataValues, and then remove it everywhere (currently used in about 50 classes and subclasses, most of them here in DataModel) in one go. It's confusing and just unnecessary to remove it from a random class just because somebody feels like, with almost no discussion and no investigation where this is used and what hassle this random breaking change will cause. With this patch there is zero breaking change to Equals methods not being symmetric when subclassing is involved is an actual, real-world problem that caused actual trouble. I spend some time working on this and solved this in all cases that are known to have subclasses, see for example |
Pinging @brightbyte. |
That makes no sense to me whatsoever. |
I'm asking for a decision to not use this interface any more, backed by a discussion that involved the team. A But as I said, not even that would mean equals methods must have restricting type hints. That's a separate discussion. |
I can follow Thiemo's argumentation here that we should for one not force a breaking change to the What I miss in this patch now is that the definition of equals is not written in EntityDocument anymore. I would like to see somewhere in EntityDocument that equals is supposed to ignore the id so that it becomes part of its contract. |
I disagree. It's a common, consistent contract for all classes implementing this interface. You can see On the other hand, with a restricting type hint, you loose any guarantee, because there can not be a common interface for this any more. How do you make a guarantee that an object does have an |
You misunderstood my statement. I was about to say that we gain nothing from removing the interface, no matter how much we argue whether it is benefitial or not. I'd suggest to just leave it there until we find "real" reasons to change something. |
Revert unnecessary breaking change to Item::equals Merging this for now to unblock the 5.0 release. I still think we shouldn't use Comparable here, since it's useless without support for generics. But let's keep that discussion for the 6.0 release.
This mostly reverts the unnecessary breaking changes in #615. The title of that pull request was "Add equals to EntityDocument", and this is mostly what this patch now does, when you compare the code with the previous 4.4 release: The
Comparable
interface moves from the deprecated abstract base classEntity
up to theEntityDocument
interface. That's all.This patch also cleans up the release notes (extensively updated in 2df96fa, thanks a lot for that, @Benestar) and adds some missing regression tests (I tried and these tests run with 4.4).
Bug: T125636