Skip to content

Commit

Permalink
Try something
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Jan 21, 2025
1 parent 6c99853 commit 550372a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,12 @@ void RunMonkey(BreakIterator bi, RBBIMonkeyKind mk, String name, int seed, int
if (c < 0) { // TODO: deal with sets containing strings.
errln("c < 0");
}
// Do not emit surrogates on Java 8, as the behaviour of regular expressions that
// match surrogates differs there.
if (System.getProperty("java.version").startsWith("1.") &&
Character.isSurrogate((char)c)) {
continue;
}
// Do not assemble a supplementary character from randomly generated separate surrogates.
// (It could be a dictionary character)
if (c < 0x10000 && Character.isLowSurrogate((char)c) && testText.length() > 0 &&
Expand Down

0 comments on commit 550372a

Please sign in to comment.