Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-07-01 Thread Henri Yandell
On Thu, May 19, 2011 at 6:30 AM, Gary Gregory wrote: > On Thu, May 19, 2011 at 12:47 AM, Henri Yandell wrote: > >> *grumbles that they were ints and a previous RC candidate saw it >> change to Range* :) >> > > > Change it back! ;) Tongue in cheek as it might be, I think this is the right directi

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-06-19 Thread Matt Benson
On Thu, May 19, 2011 at 5:14 AM, Stephen Colebourne wrote: > I doubt that the boxing will be a major performance problem. Moreover, > its one that will have to be solved for JDK 8 anyway (as Project > Lambda needs some kind of solution to enhance primitive/object > operations). > I'd prefer to se

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-19 Thread Gary Gregory
On Thu, May 19, 2011 at 12:47 AM, Henri Yandell wrote: > *grumbles that they were ints and a previous RC candidate saw it > change to Range* :) > Change it back! ;) Gary > > My bigger complaint is the explicit casting required to pass in chars: > >new UnicodeEscaper(Range.between(0, (int

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-19 Thread Stephen Colebourne
I doubt that the boxing will be a major performance problem. Moreover, its one that will have to be solved for JDK 8 anyway (as Project Lambda needs some kind of solution to enhance primitive/object operations). If the cast is a problem, why not have four versions of the operation - Integer, Char,

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-18 Thread Henri Yandell
*grumbles that they were ints and a previous RC candidate saw it change to Range* :) My bigger complaint is the explicit casting required to pass in chars: new UnicodeEscaper(Range.between(0, (int)'E')) ? Autoboxing doesn't seem to be able to turn a char into an Integer. Hen On Wed, May 18

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-18 Thread James Ring
Hey, On Wed, May 18, 2011 at 8:37 AM, Gary Gregory wrote: > The bigger issue in my mind is why a Range does not extend Pair. It's pretty > clear (to me at least) that a range is a pair of values. Mathematically speaking a Range also has information about whether the high and low bounds are inclu

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-18 Thread sebb
On 18 May 2011 16:37, Gary Gregory wrote: > The bigger issue in my mind is why a Range does not extend Pair. It's pretty > clear (to me at least) that a range is a pair of values. Please start a new thread for that issue. AFAICT that would not help improve the performance of the Escaper classes

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-18 Thread Gary Gregory
In the same vein, we've agreed that Pair should not be final, and so if we keep Range, is should not be final either. Gary On Wed, May 18, 2011 at 11:37 AM, Gary Gregory wrote: > The bigger issue in my mind is why a Range does not extend Pair. It's > pretty clear (to me at least) that a range is

Re: [LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-18 Thread Gary Gregory
The bigger issue in my mind is why a Range does not extend Pair. It's pretty clear (to me at least) that a range is a pair of values. Because the Pair is in our tuple package, it means that it should follow tuple logic and be an ordered list of elements, in this case two elements. This means that

[LANG] unnecessary boxing in StringEscapeUtils etc.

2011-05-18 Thread sebb
I'm not happy with the boxing that is often needed to create a Range of int or long, e.g. in StringEscapeUtils. Seems to me that the UnicodeEscaper and NumericEntityEscaper classes should require ints rather than a Range, as this would cut down on the boxing and unboxing that is currently needed,