-
Bug
-
Resolution: Fixed
-
P3
-
11
-
b20
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8206827 | 12 | Joe Wang | P3 | Resolved | Fixed | team |
JDK-8206604 | 11.0.1 | Joe Wang | P3 | Resolved | Fixed | b01 |
Files read/writeString implementation could be cleaner if it throws CharacterCodingException instead of an IOException with an IllegalArgumentException as cause for the malformed or unmappable cases.
The code can be cleaner with an import of jdk.internal.misc.JavaLangAccess rather than repeating the fully qualified class name. The definition of JLA can be moved up to the top. There's also a few inconsistencies with the existing code that would be good to fix (indenting and line length issues mostly).
The test looks reasonable. In getData() then then "shouldn't happen" case should throw an exception as a NPE here might be tricky to diagnose there. Another nit is the sb field - can that be removed.
The code can be cleaner with an import of jdk.internal.misc.JavaLangAccess rather than repeating the fully qualified class name. The definition of JLA can be moved up to the top. There's also a few inconsistencies with the existing code that would be good to fix (indenting and line length issues mostly).
The test looks reasonable. In getData() then then "shouldn't happen" case should throw an exception as a NPE here might be tricky to diagnose there. Another nit is the sb field - can that be removed.
- backported by
-
JDK-8206604 (fs) Files read/writeString should throw CharacterCodingException instead of IOException with an IllegalArgumentException as cause
-
- Resolved
-
-
JDK-8206827 (fs) Files read/writeString should throw CharacterCodingException instead of IOException with an IllegalArgumentException as cause
-
- Resolved
-
- relates to
-
JDK-8201276 (fs) Add methods to Files for reading/writing a string from/to a file
-
- Resolved
-
-
JDK-8205613 (cs) MalformedInputException and UnmappableCharacterException need offset value
-
- Open
-