RFR: 8369995: Implement extra logging and/or propagate errors in X509KeyManagerImpl and fix StringIndexOutOfBoundsException [v6]
Mikhail Yankelevich
myankelevich at openjdk.org
Mon Oct 20 20:21:44 UTC 2025
On Mon, 20 Oct 2025 16:14:30 GMT, Bradford Wetmore <wetmore at openjdk.org> wrote:
>> src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java line 227:
>>
>>> 225: int secondDot = alias.indexOf('.', firstDot + 1);
>>> 226:
>>> 227: if (firstDot < 1 ||
>>
>> Nit: `||` should be first on the new line per style guide.
>
> Nit: I prefer to (over)use commas to indicate exactly what you intended.
>
> Artur is right on the `||`, but I am guilty of doing it your way. :)
>
> That said, the next lines in a conditional should be indented by 8.
>
> if ((firstDot < 1) || (secondDot - firstDot < 2) ||
> (alias.length() - secondDot < 2))
> if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) {
> SSLLogger.warning("Invalid alias format: " + alias);
> }
Done in the next commit
>> test/jdk/sun/security/ssl/X509KeyManager/NullCases.java line 68:
>>
>>> 66:
>>> 67: public class NullCases {
>>> 68: private static final String KEY_MGR_EXCEPTION_MESSAGE = "Exception thrown while getting an alias";
>>
>> Line length.
>
> I noticed several other cases here. Please keep line lengths to <=80.
Done in the next commit
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27851#discussion_r2446017042
PR Review Comment: https://git.openjdk.org/jdk/pull/27851#discussion_r2446012829
More information about the security-dev
mailing list