Skip to content

Commit

Permalink
8273430: Suspicious duplicate condition in java.util.regex.Grapheme#i…
Browse files Browse the repository at this point in the history
…sExcludedSpacingMark

Backport-of: 3d9dc8f824abf597d9b28f456cfeb5af927221b8
  • Loading branch information
synecdoche authored and Victor Rudometov committed Jul 22, 2024
1 parent e49367b commit 0bc3783
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 392 deletions.
8 changes: 4 additions & 4 deletions src/java.base/share/classes/java/util/regex/Grapheme.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -151,10 +151,10 @@ static int nextBoundary(CharSequence src, int off, int limit) {
// #tr29: SpacingMark exceptions: The following (which have
// General_Category = Spacing_Mark and would otherwise be included)
// are specifically excluded
private static boolean isExcludedSpacingMark(int cp) {
static boolean isExcludedSpacingMark(int cp) {
return cp == 0x102B || cp == 0x102C || cp == 0x1038 ||
cp >= 0x1062 && cp <= 0x1064 ||
cp >= 0x1062 && cp <= 0x106D ||
cp >= 0x1067 && cp <= 0x106D ||
cp == 0x1083 ||
cp >= 0x1087 && cp <= 0x108C ||
cp == 0x108F ||
Expand All @@ -164,7 +164,7 @@ private static boolean isExcludedSpacingMark(int cp) {
}

@SuppressWarnings("fallthrough")
private static int getType(int cp) {
static int getType(int cp) {
if (cp < 0x007F) { // ASCII
if (cp < 32) { // Control characters
if (cp == 0x000D)
Expand Down
Loading

1 comment on commit 0bc3783

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.