On 18 January 2012 20:09, Joe Darcy <[email protected]> wrote:

>
> On 01/18/2012 11:21 AM, Roger Riggs wrote:
>
>> A comment or two on the webrev for unsigned:
>>
>>     http://cr.openjdk.java.net/~darcy/4504839.2
>>
>> 1. In the new parsing methods, could the String arguments be changed to
>> the more general
>> java.lang.CharSequence? For many parsing applications, it could be more
>> convenient
>> to pass a CharSequence than to create a new String.
>>
>
>
> I don't think that would be very helpful in this case.  If the methods
> were changed to take a CharSequence, the first action I'd write in the
> method would be to call toString on the argument; this is necessary to
> guard against the class of time-of-check-versus-time-of-use problems
> because the CharSequence objects can be mutable.


FWIW, JSR-310 and Joda-Time users have both requested CharSequence for
parsing. A key use case was apparantly reading streams in Scala, although I
didn't really follow that in detail.

Stephen

Reply via email to