mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8205058: (fs) Files read/writeString should throw CharacterCodingException instead of IOException with an IllegalArgumentException as cause
Reviewed-by: sherman, alanb, lancea
This commit is contained in:
parent
884f9db3c6
commit
e5ac84c7b0
5 changed files with 80 additions and 49 deletions
|
@ -41,6 +41,7 @@ import java.lang.reflect.Executable;
|
|||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URI;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
import java.security.AccessControlContext;
|
||||
import java.security.ProtectionDomain;
|
||||
import java.security.AccessController;
|
||||
|
@ -2184,11 +2185,11 @@ public final class System {
|
|||
return ModuleLayer.layers(loader);
|
||||
}
|
||||
|
||||
public String newStringNoRepl(byte[] bytes, Charset cs) {
|
||||
public String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException {
|
||||
return StringCoding.newStringNoRepl(bytes, cs);
|
||||
}
|
||||
|
||||
public byte[] getBytesNoRepl(String s, Charset cs) {
|
||||
public byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException {
|
||||
return StringCoding.getBytesNoRepl(s, cs);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue