[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: Re: RFR: 8267505: {List, Set, Map}PropertyBase::bind should check against identity
From: Marius Hanl <github.com+66004280+maran23 () openjdk ! java ! net>
Date: 2021-05-29 0:26:15
Message-ID: R3ynlZp_ZWgKKD6bvQcmYq2A8risMYtsoeUlRJyZGQo=.ab366536-962e-4b4c-8d7c-d86fb27d688d () github ! com
[Download RAW message or body]
On Mon, 24 May 2021 11:56:35 GMT, Jose Pereda <jpereda@openjdk.org> wrote:
> ListPropertyBase::bind, SetPropertyBase::bind, MapPropertyBase::bind have a check \
> on whether a different instance of the observable is the same, and this PR changes \
> that to check against identity.
> Tests are included.
Looks good. Verified tests failing before and succeed after the fix.
One side note which might explaing, why equals was used: The super class \
`ReadOnlyList/Set/MapProperty` have hashcode/equals overridden, where equals accepts \
the corresponding collection (List/Set/Map), which is then checked against the \
collection the property has set.
This is fine, although it looks a bit weird at first as the equals expects a \
collection, not a property. But it makes sense as all those classes implements the \
corresponding collection interface (List/Map/Set).
And a quick look in the history is showing, that at first the equals was really \
checking for a property (and in there: bean and name), which makes \
`normalList.equals(listProperty)` never work. So maybe this is leftover code from the \
old implementaation.
-------------
Marked as reviewed by Maran23@github.com (no known OpenJDK username).
PR: https://git.openjdk.java.net/jfx/pull/516
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic