Re: java.util.Pair

2017-07-15 Thread Attila Szegedi
>>> De: "John Rose" <john.r.r...@oracle.com> >>> À: "Rémi Forax" <fo...@univ-mlv.fr> >>> Cc: "joe darcy" <joe.da...@oracle.com>, "core-libs-dev" >>> <core-libs-dev@openjdk.java.net> >>> Envoyé: Jeu

Re: java.util.Pair

2017-07-13 Thread kedar mhaswade
3/2017 05:41 PM, fo...@univ-mlv.fr wrote: > >> De: "John Rose" <john.r.r...@oracle.com> >>> À: "Rémi Forax" <fo...@univ-mlv.fr> >>> Cc: "joe darcy" <joe.da...@oracle.com>, "core-libs-dev" >>> <core-libs-de

Re: java.util.Pair

2017-07-13 Thread Dave Brosius
;John Rose" <john.r.r...@oracle.com> À: "Rémi Forax" <fo...@univ-mlv.fr> Cc: "joe darcy" <joe.da...@oracle.com>, "core-libs-dev" <core-libs-dev@openjdk.java.net> Envoyé: Jeudi 13 Juillet 2017 23:05:14 Objet: Re: java.util.Pair On Jul 13, 2017,

Re: java.util.Pair

2017-07-13 Thread forax
> De: "John Rose" <john.r.r...@oracle.com> > À: "Rémi Forax" <fo...@univ-mlv.fr> > Cc: "joe darcy" <joe.da...@oracle.com>, "core-libs-dev" > <core-libs-dev@openjdk.java.net> > Envoyé: Jeudi 13 Juillet 2017

Re: java.util.Pair

2017-07-13 Thread John Rose
On Jul 13, 2017, at 1:39 PM, Remi Forax wrote: > > Tuples are like an array of value types parameterized by a constant integer The homogeneous case is pretty simple; most of what you need is to allow a generic type to be parameterized by an integer. C++ templates have had

Re: java.util.Pair

2017-07-13 Thread Remi Forax
da...@oracle.com> > À: "Hohensee, Paul" <hohen...@amazon.com>, core-libs-dev@openjdk.java.net > Envoyé: Jeudi 13 Juillet 2017 19:22:19 > Objet: Re: java.util.Pair > Hi Paul, > > See the discussion in thread: > > http://mail.openjdk.jav

Re: java.util.Pair

2017-07-13 Thread John Rose
On Jul 13, 2017, at 10:29 AM, Maurizio Cimadamore wrote: > > Maybe automatic refactoring to Map.Entry ? With the new static method added > in 9, creating one is also very fluent (but I > know that Entry doesn't convey same meaning as Pair in method >

Re: java.util.Pair

2017-07-13 Thread Vitaly Davidovich
; > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-April/thread.html > > > > > > In short, no current plans to add java.util.Pair. > > > > -Joe > > > > > > On 7/13/2017 10:07 AM, Hohensee, Paul wrote: > >> See the ancie

Re: java.util.Pair

2017-07-13 Thread Gary Gregory
va.net/pipermail/core-libs-dev/2010- > March/003973.html > http://mail.openjdk.java.net/pipermail/core-libs-dev/2010- > April/thread.html > > In short, no current plans to add java.util.Pair. > > -Joe > > > On 7/13/2017 10:07 AM, Hohensee, Paul wrote:

Re: java.util.Pair

2017-07-13 Thread Hohensee, Paul
In short, no current plans to add java.util.Pair. -Joe On 7/13/2017 10:07 AM, Hohensee, Paul wrote: > See the ancient https://bugs.openjdk.java.net/browse/JDK-4947273. > > At Amazon, many projects depend on JavaFX to get only a single class,

Re: java.util.Pair

2017-07-13 Thread Hohensee, Paul
> See the discussion in thread: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-March/003973.html > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-April/thread.html > > > In short, no current plans to add java.util.Pair.

Re: java.util.Pair

2017-07-13 Thread Maurizio Cimadamore
On 13/07/17 18:22, joe darcy wrote: Hi Paul, See the discussion in thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-March/003973.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-April/thread.html In short, no current plans to add java.util.Pair. -Joe On 7

Re: java.util.Pair

2017-07-13 Thread joe darcy
Hi Paul, See the discussion in thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-March/003973.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-April/thread.html In short, no current plans to add java.util.Pair. -Joe On 7/13/2017 10:07 AM, Hohensee, Paul wrote

java.util.Pair

2017-07-13 Thread Hohensee, Paul
package, both of which we’d like to avoid in the future. So, are there any plans to add java.util.Pair to JDK10? Thanks, Paul

Re: java.util.Pair

2010-04-02 Thread tom . hawtin
On 30/03/2010 09:08, Weijun Wang wrote: I know such a simple thing can be made very complex and everyone might want to add a new method into it. How about we just make it most primitive? Simply an immutable and Serializable class, two final fields, one constructor, two getters (?), and no

Re: java.util.Pair

2010-03-31 Thread Rémi Forax
in the JDK to prevent the proliferation of yet more Pair classes in other code bases. I should know better than to take the bait, below is a first cut at java.util.Pair. In equals, instanceof Pair should be instanceof Pair?,?. Pair is a raw type. getA()/getB should be renamed to getFirst

Re: java.util.Pair

2010-03-31 Thread Kevin Bourrillion
On Wed, Mar 31, 2010 at 12:31 AM, Rémi Forax fo...@univ-mlv.fr wrote: In equals, instanceof Pair should be instanceof Pair?,?. Pair is a raw type. Tangent: there are those of us who believe javac is quite mistaken to issue a warning on 'instanceof Pair'. (And even if it were right in theory

Re: java.util.Pair

2010-03-31 Thread Mark Reinhold
Date: Wed, 31 Mar 2010 09:14:59 -0700 From: Kevin Bourrillion kev...@google.com ... The problem is that classes like Pair simply go that much further to indulge the desire to never have to create any actual types of our own. When we're forced to create our own types, we begin to model

Re: java.util.Pair

2010-03-31 Thread Rémi Forax
Le 31/03/2010 17:34, Kevin Bourrillion a écrit : On Wed, Mar 31, 2010 at 12:31 AM, Rémi Forax fo...@univ-mlv.fr mailto:fo...@univ-mlv.fr wrote: In equals, instanceof Pair should be instanceof Pair?,?. Pair is a raw type. Tangent: there are those of us who believe javac is quite

Re: java.util.Pair

2010-03-31 Thread Kevin Bourrillion
On Wed, Mar 31, 2010 at 10:04 AM, Rémi Forax fo...@univ-mlv.fr wrote: (And even if it were right in theory (which I don't think it is), weren't warnings supposed to be things that would warn you about possible *bugs*?) possible bug: the semantics of instanceof Foo and instanceof Foo? is

Re: java.util.Pair

2010-03-31 Thread Neal Gafter
On Wed, Mar 31, 2010 at 10:20 AM, Kevin Bourrillion kev...@google.comwrote: With all due respect, I rest my case. :-) (Meaning: since you chose such a hypothetical future situation as an illustration, it suggests that indeed no actual bugs are being prevented here in the real world.) We

Re: java.util.Pair

2010-03-31 Thread Paulo Levi
Please don't add this. I have my own tuple parametric class. In fact it is easy to do. http://code.google.com/p/bookjar-utils/source/browse/BookJar-utils/src/util/Tuples.java However i never use it anymore. It is easy to do use, but really stupid since the names (first, second, third...) are so

java.util.Pair

2010-03-30 Thread Weijun Wang
Hi All There are multiple CRs asking for a java.util.Pair class: 4983155 6229146 4947273 I know such a simple thing can be made very complex and everyone might want to add a new method into it. How about we just make it most primitive? Simply an immutable and Serializable class, two

Re: java.util.Pair

2010-03-30 Thread Bruce Chapman
Weijun Wang wrote: Hi All There are multiple CRs asking for a java.util.Pair class: 4983155 6229146 4947273 I know such a simple thing can be made very complex and everyone might want to add a new method into it. How about we just make it most primitive? Simply an immutable

Re: java.util.Pair

2010-03-30 Thread assembling signals
...@sun.com: Hi All There are multiple CRs asking for a java.util.Pair class: 4983155 6229146 4947273 I know such a simple thing can be made very complex and everyone might want to add a new method into it. How about we just make it most primitive? Simply

Re: java.util.Pair

2010-03-30 Thread Kevin Bourrillion
, 2010 at 1:08 AM, Weijun Wang weijun.w...@sun.com wrote: Hi All There are multiple CRs asking for a java.util.Pair class: 4983155 6229146 4947273 I know such a simple thing can be made very complex and everyone might want to add a new method into it. How about we just make it most

Re: java.util.Pair

2010-03-30 Thread Stephen Colebourne
Wang weijun.w...@sun.com wrote: Hi All There are multiple CRs asking for a java.util.Pair class:   4983155   6229146   4947273 I know such a simple thing can be made very complex and everyone might want to add a new method into it. How about we just make it most primitive? Simply

Re: java.util.Pair

2010-03-30 Thread Martin Buchholz
On Tue, Mar 30, 2010 at 13:39, Stephen Colebourne scolebou...@joda.org wrote: While I support Kevin´s summary, having a public implementation of Map.Entry in java.util would be very useful. (Along with making other private classes public - unmodifiable iterator is one IIRC)

Re: java.util.Pair

2010-03-30 Thread Stephen Colebourne
(I´m writing from a slow connection in a national park in Chile) I meant a decortator for an iterator that wraps the original making it immutable. Stephen On 30 March 2010 16:55, Martin Buchholz marti...@google.com wrote: On Tue, Mar 30, 2010 at 13:39, Stephen Colebourne scolebou...@joda.org

RE: java.util.Pair

2010-03-30 Thread Jason Mehrens
, is there is there a corner case that I'm not seeing or is the main reservation the extra method calls and creation of some well behaved garbage? Jason Date: Tue, 30 Mar 2010 17:01:57 -0400 Subject: Re: java.util.Pair From: scolebou...@joda.org To: core-libs-dev@openjdk.java.net (I´m writing from

Re: java.util.Pair

2010-03-30 Thread joe . darcy
Pair classes in other code bases. I should know better than to take the bait, below is a first cut at java.util.Pair. -Joe package java.util; import java.util.Objects; /** * An immutable pair of values. The values may be null. The values * themselves may be mutable. * * @param A the type