On Fri, 7 Mar 2025 15:46:05 GMT, Artur Barashev <abaras...@openjdk.org> wrote:
>> src/java.base/share/classes/sun/security/ssl/SSLScope.java line 39: >> >>> 37: >>> 38: // Note: the SSLScope is case-insensitive. >>> 39: public static SSLScope nameOf(String name) { >> >> `valueOf` is probably a better name, and used by other Enum classes for this >> pattern. > > Actually I couldn't find a single example of using `valueOf` with String > argument in `sun/security/ssl`, while there are plenty of examples of using > `nameOf`. So I just followed the established convention: > > src/java.base/share/classes/sun/security/ssl/SSLScope.java:39: > src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java:214: > src/java.base/share/classes/sun/security/ssl/CipherSuite.java:925: > src/java.base/share/classes/sun/security/ssl/NamedGroup.java:352: > src/java.base/share/classes/sun/security/ssl/SignatureScheme.java:349: Sure, that's fine. I was thinking that the name was more consistent with the `Enum.valuesOf` method. But these are names or types rather than values, and this class is internal, so we don't have to follow that convention. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23681#discussion_r1985488104