JDK 8 code review request for initial unsigned integer

Joe Darcy joe.darcy at oracle.com
Wed Jan 18 20:09:46 UTC 2012


Hi Roger,

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.

>
> For consistency, should all of the parse methods be converted from 
> String to CharSequence?

Given the timing of the introduction of String and CharSequence to the 
platform, I don't think a bulk introduction of CharSequence parsing 
methods now is necessary.

>
> 2. To be consistent, the new thrown exception messages should not end 
> with a period (".")
>
>

I'll look over the exception messages to see that they are formatted 
consistently.

Thanks,

-Joe




More information about the core-libs-dev mailing list