RFR (JDK10) 8183743: Umbrella: add overloads that take a Charset parameter

Joe Wang huizhe.wang at oracle.com
Fri Dec 1 20:35:36 UTC 2017

On 12/1/17, 3:16 AM, Alan Bateman wrote:
> On 01/12/2017 06:11, Joe Wang wrote:
>> Hi,
>> Adding convenient methods that take a Charset to several classes that 
>> have already had methods with a Charset/Encoding name as a parameter. 
>> To avoid any impact on compatibility and JCK tests, we've kept the 
>> existing methods virtually untouched except making a reference to the 
>> new ones to encourage the use of these new methods going forward. The 
>> javadocs of the new methods however, may be more complete with 
>> details on handling edge cases / Exceptions.
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8183743
>> webrev: 
>> http://cr.openjdk.java.net/~joehw/jdk10/8183743/webrev/index.html
> I looked through the javadoc for the updated/new methods and it mostly 
> looks good.

Thanks for all of the reviews!
> I think URLDecoder.decode methods should have @throws 
> IllegalArgumentException. I realize it's implementation specific as to 
> whether IAE is thrown with bad input but given that the RI does throw 
> IAE then consumers of the API should be prepared for it. The @implNote 
> can stay and probably should be copied into the legacy decode method too.

I added @throws IAE. On a 2nd thought, would that give no flexibility to 
alternative impls as the general (class) spec had given? With this 
addition, it becomes a requirement.
> One of the new constructors on Scanner needs @since 10.



> -Alan

More information about the core-libs-dev mailing list