RFR: 8372950: Pem.pemEncoded should cache the Pattern

Fernando Guallini fguallini at openjdk.org
Mon Dec 8 17:07:51 UTC 2025


PEM is using the String.replaceAll() method that creates a Pattern internally every time. This looks like a minor inefficiency and since it is caching Patterns for other cases, it should do the same here.

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

Commit messages:
 - renamed
 - regex cached

Changes: https://git.openjdk.org/jdk/pull/28661/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28661&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372950
  Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28661.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28661/head:pull/28661

PR: https://git.openjdk.org/jdk/pull/28661


More information about the security-dev mailing list