8273430: Suspicious duplicate condition in java.util.regex.Grapheme#isExcludedSpacingMark

Reviewed-by: naoto
This commit is contained in:
Ian Graves 2021-09-13 21:48:28 +00:00
parent 5095068d3b
commit 3d9dc8f824
4 changed files with 151 additions and 392 deletions

View file

@ -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
@ -151,10 +151,10 @@ final class Grapheme {
// #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 ||
@ -164,7 +164,7 @@ final class Grapheme {
}
@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)