RFR: JDK-8263261 Extend String::translateEscapes to support unicode escapes [v7]

Roger Riggs rriggs at openjdk.org
Fri Jan 19 18:31:33 UTC 2024


On Fri, 19 Jan 2024 18:23:40 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> Currently String::translateEscapes does not support unicode escapes, reported as a IllegalArgumentException("Invalid escape sequence: ..."). String::translateEscapes should translate unicode escape sequences to provide full coverage,
>
> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update Copyright

test/jdk/java/lang/String/TranslateEscapes.java line 113:

> 111:     }
> 112: 
> 113:     static void verifyEscape(String string1, String string2) {

These are unicode escapes too.  The method name should reflect that.

test/jdk/java/lang/String/TranslateEscapes.java line 127:

> 125:         } catch (IllegalArgumentException ex) {
> 126:         }
> 127:     }

The method name implies valid unicode escape sequences, but they are all invalid.
The method name could be "verifyIllegalUnicodeEscape`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17491#discussion_r1459509112
PR Review Comment: https://git.openjdk.org/jdk/pull/17491#discussion_r1459505939


More information about the core-libs-dev mailing list