> sorry for all the noise.
I am also so sorry for my noise.
> See PairTest.testPairOfAbstractMapSimpleEntry().
You explained everything. Thank you.
sebb ezt írta (időpont: 2024. szept. 26., Cs, 16:23):
> On Thu, 26 Sept 2024 at 14:52, Gary Gregory
> wrote:
> >
> > Sebb,
> >
> > Pair _is_ a Ma
On Thu, 26 Sept 2024 at 14:52, Gary Gregory wrote:
>
> Sebb,
>
> Pair _is_ a Map.Entry.
I get it now, sorry for all the noise.
As you wrote at the start, the examples are not valid Map.Entry
instances, so their behaviour is not guaranteed.
It's not sufficient to satisfy the compiler.
The implem
Sebb,
Pair _is_ a Map.Entry.
Gary
On Thu, Sep 26, 2024, 9:46 AM sebb wrote:
> On Thu, 26 Sept 2024 at 14:33, Gary D. Gregory
> wrote:
> >
> > Andrea,
> >
> > The relevant contract is
> https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.Entry.html#equals(java.lang.Objec
On Thu, 26 Sept 2024 at 14:33, Gary D. Gregory wrote:
>
> Andrea,
>
> The relevant contract is
> https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.Entry.html#equals(java.lang.Object)
Which says "Returns true if the given object is also a map entry and ..."
Also any clas
Andrea,
The relevant contract is
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.Entry.html#equals(java.lang.Object)
Gary
On 2024/09/26 12:45:07 Andrea Spinelli wrote:
> IMHO, a Pair should not be equal to anything which is not a Pair.
>
> Reading the contract for eq
IMHO, a Pair should not be equal to anything which is not a Pair.
Reading the contract for equals
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)
it must be symmetric, so Pair.equals should return false if the argument is a
MapEntry