On Tue, 28 Apr 2026 04:46:30 GMT, Jaikiran Pai <[email protected]> wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Add `ofString` static factory method
>
> src/java.base/share/classes/javax/net/ssl/SNIHostName.java line 124:
>
>> 122: }
>> 123:
>> 124: private SNIHostName(String hostname, boolean strict) {
>
> Perhaps call it `allowIPLiteral`, instead of `strict`, to be more precise?
The reason I've opted for the _"strict"_ wording is that the documentation of
the deprecated constructors and the new static factory methods state that the
latter has _"stricter"_ checks, and users are advised to take measures for an
`IAE` that might be thrown. The `strict` flag indicates if the stricter checks
are toggled. Right now, it only checks for IP literals. Though having a
generalized name (instead of something more specialized) allows extensibility
without breaking the API contract.
> src/java.base/share/classes/javax/net/ssl/SNIHostName.java line 443:
>
>> 441: // and not all call-sites have the sufficient `catch (IAE)`
>> safety net.
>> 442: // Hence, the strict checks enhancement is carried out as an
>> opt-in
>> 443: // feature.
>
> I think we should remove this code comment. This rationale I think is better
> captured in the CSR or the JBS issue of this change.
Simplified the comment in 9596a5b2ca0.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30747#discussion_r3153732223
PR Review Comment: https://git.openjdk.org/jdk/pull/30747#discussion_r3153736297