RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern

Alan Bateman alanb at openjdk.org
Tue Jan 17 10:10:13 UTC 2023


On Tue, 17 Jan 2023 09:44:17 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> - Strengthen a computation that could overflow.
> - Specify that use of CANON_EQ could exhaust memory in the compilation phase.

src/java.base/share/classes/java/util/regex/Pattern.java line 1099:

> 1097:      * flags.
> 1098:      *
> 1099:      * <p>Setting {@link #CANON_EQ} among the flags may impose a moderate risk

This may be a candidate for `@apiNote`, same thing for the note added to CANON_EQ.

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

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


More information about the core-libs-dev mailing list