RFR: 8349121: SSLParameters.setApplicationProtocols() ALPN example could be clarified [v3]

Daniel Fuchs dfuchs at openjdk.org
Wed Feb 5 12:06:10 UTC 2025


On Tue, 4 Feb 2025 19:42:24 GMT, Bradford Wetmore <wetmore at openjdk.org> wrote:

>> Update and clarify the sample code.
>> 
>> Docs only, no additional testing other than verifying javadoc is correctly output.
>
> Bradford Wetmore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Codereview Comments

src/java.base/share/classes/javax/net/ssl/SSLParameters.java line 661:

> 659:      *     // Encode 3 Meetei Mayek letters (HUK, UN, I) using Unicode Escapes
> 660:      *     //     0xabcd->0xabcf, 2 Unicode bytes/letter.
> 661:      *     String HUK_UN_I =  "\u005cuabcd\u005cuabce\u005cuabcf";

jshell> String HUK_UN_I =  "\u005cuabcd\u005cuabce\u005cuabcf";
|  Error:
|  illegal escape character
|  String HUK_UN_I =  "\u005cuabcd\u005cuabce\u005cuabcf";
|                            ^
|  Error:
|  illegal escape character
|  String HUK_UN_I =  "\u005cuabcd\u005cuabce\u005cuabcf";
|                                       ^
|  Error:
|  illegal escape character
|  String HUK_UN_I =  "\u005cuabcd\u005cuabce\u005cuabcf";
|                                                  ^

src/java.base/share/classes/javax/net/ssl/SSLParameters.java line 672:

> 670:      *     // Also, encode a two byte RFC 8701 GREASE ALPN value
> 671:      *     //     e.g. 0x0A, 0x1A, 0x2A...0xFA
> 672:      *     String rfc8701Grease8A = "\u005cu008A\u005cu008A";

jshell> String rfc8701Grease8A = "\u005cu008A\u005cu008A";
|  Error:
|  illegal escape character
|  String rfc8701Grease8A = "\u005cu008A\u005cu008A";
|                                  ^
|  Error:
|  illegal escape character
|  String rfc8701Grease8A = "\u005cu008A\u005cu008A";
|                                             ^

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23379#discussion_r1942749685
PR Review Comment: https://git.openjdk.org/jdk/pull/23379#discussion_r1942746393


More information about the net-dev mailing list