commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [LANG] unnecessary boxing in StringEscapeUtils etc.
Date Thu, 19 May 2011 13:30:39 GMT
On Thu, May 19, 2011 at 12:47 AM, Henri Yandell <flamefew@gmail.com> 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)'E')) ?
>
> Autoboxing doesn't seem to be able to turn a char into an Integer.
>
> Hen
>
> On Wed, May 18, 2011 at 6:53 AM, sebb <sebbaz@gmail.com> wrote:
> > 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, as well as the extra
> > code needed to provide comparisons etc.
> >
> > Or, there could be a specialised IntRange class using int to provide
> > the functionality.
> >
> > These changes are new to 3.0, so could be fixed now without backward
> > compat. problems.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
Thank you,
Gary

http://garygregory.wordpress.com/
http://garygregory.com/
http://people.apache.org/~ggregory/
http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message