RFR: 8358319: Pem.decode should cache the Pattern

Aleksey Shipilev shade at openjdk.org
Tue Jun 3 08:17:00 UTC 2025


On Mon, 2 Jun 2025 11:10:04 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> SonarCloud complains we are using the String.replaceAll() method that creates Pattern internally every time. This looks a minor inefficiency in preview feature, but we can fix it from the day 1. Also fixed the variable name style in adjacent cached Pattern.
> 
> Additional testing:
>  - [x] Linux x86_64 server fastdebug, `jdk_security`

Here goes.

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

PR Comment: https://git.openjdk.org/jdk/pull/25583#issuecomment-2934061689


More information about the security-dev mailing list