Re: java.util.Pair

2017-07-15 Thread Attila Szegedi
t;John Rose" >>> À: "Rémi Forax" >>> Cc: "joe darcy" , "core-libs-dev" >>> >>> Envoyé: Jeudi 13 Juillet 2017 23:05:14 >>> Objet: Re: java.util.Pair >>> On Jul 13, 2017, at 1:39 PM, Remi Forax < [ mailto:fo...@un

Re: java.util.Pair

2017-07-13 Thread kedar mhaswade
v.fr wrote: > >> De: "John Rose" >>> À: "Rémi Forax" >>> Cc: "joe darcy" , "core-libs-dev" >>> >>> Envoyé: Jeudi 13 Juillet 2017 23:05:14 >>> Objet: Re: java.util.Pair >>> On Jul 13, 2017, at 1:3

Re: java.util.Pair

2017-07-13 Thread Dave Brosius
"John Rose" À: "Rémi Forax" Cc: "joe darcy" , "core-libs-dev" Envoyé: Jeudi 13 Juillet 2017 23:05:14 Objet: Re: java.util.Pair On Jul 13, 2017, at 1:39 PM, Remi Forax < [ mailto:fo...@univ-mlv.fr | fo...@univ-mlv.fr ] > wrote: Tuples are like an array

Re: java.util.Pair

2017-07-13 Thread forax
> De: "John Rose" > À: "Rémi Forax" > Cc: "joe darcy" , "core-libs-dev" > > Envoyé: Jeudi 13 Juillet 2017 23:05:14 > Objet: Re: java.util.Pair > On Jul 13, 2017, at 1:39 PM, Remi Forax < [ mailto:fo...@univ-mlv.fr | > fo...

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 that for a long time.

Re: java.util.Pair

2017-07-13 Thread Remi Forax
"Hohensee, Paul" , 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.java.net/pipermail/core-libs-dev/2010-March/003973.html > http://mail.o

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 > signatures/fields) The JavaFX Pair Paul is

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

Re: java.util.Pair

2017-07-13 Thread Gary Gregory
t; 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 ancient https://bugs.openjdk.java.net

Re: java.util.Pair

2017-07-13 Thread Hohensee, Paul
t 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, namely javafx.util.Pair. That

Re: java.util.Pair

2017-07-13 Thread Hohensee, Paul
hread: > > 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 >

Re: java.util.Pair

2017-07-13 Thread Maurizio Cimadamore
rizio 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

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-04-01 Thread Goktug Gokdogan
DK 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. > > -Joe > > package java.util; > > import java.util.Objects; > > /** > * An immutable pai

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

Re: java.util.Pair

2010-03-31 Thread Neal Gafter
On Wed, Mar 31, 2010 at 10:20 AM, Kevin Bourrillion wrote: > 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 have to recog

Re: java.util.Pair

2010-03-31 Thread Kevin Bourrillion
On Wed, Mar 31, 2010 at 10:04 AM, Rémi Forax 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 different if > ge

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 > 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 warn

Re: java.util.Pair

2010-03-31 Thread Joshua Bloch
Just to add my voice to the chorus, I think adding pair is seductive but ill-considered. Based on our experience at Google, I believe it makes a bad situation worse. I do believe that Kevin's idea is worth of exploration: in essence trying to encapsulate all of the knowledge in Chapter 3 of Effec

Re: java.util.Pair

2010-03-31 Thread Mark Reinhold
> Date: Wed, 31 Mar 2010 09:14:59 -0700 > From: Kevin Bourrillion > ... > > 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 our data more

Re: java.util.Pair

2010-03-31 Thread Kevin Bourrillion
On Wed, Mar 31, 2010 at 8:36 AM, Bob Lee wrote: Please don't add Pair. It should never be used in APIs. Adding it to > java.util will enable and even encourage its use in APIs. The damage done to > future Java APIs will be far worse than a few duplicate copies of Pair (I > don't even see that man

Re: java.util.Pair

2010-03-31 Thread Bob Lee
On Tue, Mar 30, 2010 at 4:34 PM, wrote: > While I have sympathy with that conclusion, there is the > side-effect of littering many APIs with the flotsam of lots of different > classes named "Pair." My inclination would be to produce one adequate > Pair class in the JDK to prevent the proliferati

Re: java.util.Pair

2010-03-31 Thread Kevin Bourrillion
On Wed, Mar 31, 2010 at 12:31 AM, Rémi Forax 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 (which I don't think

Re: java.util.Pair

2010-03-31 Thread Weijun Wang
e flotsam of lots of different > classes named "Pair." My inclination would be to produce one adequate > Pair class 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

Re: java.util.Pair

2010-03-31 Thread Rémi Forax
Pair class 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 t

Re: java.util.Pair

2010-03-30 Thread joe . darcy
f 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. -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

RE: java.util.Pair

2010-03-30 Thread Jason Mehrens
re 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

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 wrote: > On Tue, Mar 30, 2010 at 13:39, Stephen Colebourne > wrote: >> While I support Kevin´s sum

Re: java.util.Pair

2010-03-30 Thread Martin Buchholz
On Tue, Mar 30, 2010 at 13:39, Stephen Colebourne 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) ./AbstractMap.java:569:public sta

Re: java.util.Pair

2010-03-30 Thread Stephen Colebourne
M, 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

Re: java.util.Pair

2010-03-30 Thread Kevin Bourrillion
, 2010 at 1:08 AM, 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

Re: java.util.Pair

2010-03-30 Thread assembling signals
;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 abou

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 and

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