Skip to content

8263091: Remove CharacterData.isOtherUppercase/-Lowercase #2846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions make/data/characterdata/CharacterData00.java.template
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,6 @@ class CharacterData00 extends CharacterData {
return (props & $$maskType);
}

boolean isOtherLowercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherLowercase) != 0;
}

boolean isOtherUppercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherUppercase) != 0;
}

boolean isOtherAlphabetic(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherAlphabetic) != 0;
Expand Down Expand Up @@ -765,13 +755,13 @@ class CharacterData00 extends CharacterData {
}

boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.LOWERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherLowercase) != 0;
}

boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.UPPERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherUppercase) != 0;
}

boolean isWhitespace(int ch) {
Expand Down
18 changes: 4 additions & 14 deletions make/data/characterdata/CharacterData01.java.template
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ class CharacterData01 extends CharacterData {
return (props & $$maskType);
}

boolean isOtherLowercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherLowercase) != 0;
}

boolean isOtherUppercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherUppercase) != 0;
}

boolean isOtherAlphabetic(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherAlphabetic) != 0;
Expand Down Expand Up @@ -503,13 +493,13 @@ class CharacterData01 extends CharacterData {
}

boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.LOWERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherLowercase) != 0;
}

boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.UPPERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherUppercase) != 0;
}

boolean isWhitespace(int ch) {
Expand Down
19 changes: 5 additions & 14 deletions make/data/characterdata/CharacterData02.java.template
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,6 @@ class CharacterData02 extends CharacterData {
return props;
}

boolean isOtherLowercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherLowercase) != 0;
}

boolean isOtherUppercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherUppercase) != 0;
}

boolean isOtherAlphabetic(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherAlphabetic) != 0;
Expand Down Expand Up @@ -222,15 +212,16 @@ class CharacterData02 extends CharacterData {
}

boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.LOWERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherLowercase) != 0;
}

boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.UPPERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherUppercase) != 0;
}


boolean isWhitespace(int ch) {
return (getProperties(ch) & $$maskIdentifierInfo) == $$valueJavaWhitespace;
}
Expand Down
18 changes: 4 additions & 14 deletions make/data/characterdata/CharacterData03.java.template
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,6 @@ class CharacterData03 extends CharacterData {
return props;
}

boolean isOtherLowercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherLowercase) != 0;
}

boolean isOtherUppercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherUppercase) != 0;
}

boolean isOtherAlphabetic(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherAlphabetic) != 0;
Expand Down Expand Up @@ -222,13 +212,13 @@ class CharacterData03 extends CharacterData {
}

boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.LOWERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherLowercase) != 0;
}

boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.UPPERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherUppercase) != 0;
}

boolean isWhitespace(int ch) {
Expand Down
18 changes: 4 additions & 14 deletions make/data/characterdata/CharacterData0E.java.template
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,6 @@ class CharacterData0E extends CharacterData {
return props;
}

boolean isOtherLowercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherLowercase) != 0;
}

boolean isOtherUppercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherUppercase) != 0;
}

boolean isOtherAlphabetic(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherAlphabetic) != 0;
Expand Down Expand Up @@ -222,13 +212,13 @@ class CharacterData0E extends CharacterData {
}

boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.LOWERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherLowercase) != 0;
}

boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.UPPERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherUppercase) != 0;
}

boolean isWhitespace(int ch) {
Expand Down
19 changes: 4 additions & 15 deletions make/data/characterdata/CharacterDataLatin1.java.template
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,13 @@ class CharacterDataLatin1 extends CharacterData {

@IntrinsicCandidate
boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.LOWERCASE_LETTER;
return (getProperties(ch) & $$maskType) == Character.LOWERCASE_LETTER
|| (getPropertiesEx(ch) & $$maskOtherLowercase) != 0; // 0xaa, 0xba
}

@IntrinsicCandidate
boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & $$maskType) == Character.UPPERCASE_LETTER;
}

boolean isOtherLowercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherLowercase) != 0;
}

boolean isOtherUppercase(int ch) {
int props = getPropertiesEx(ch);
return (props & $$maskOtherUppercase) != 0;
return (getProperties(ch) & $$maskType) == Character.UPPERCASE_LETTER;
}

boolean isOtherAlphabetic(int ch) {
Expand Down Expand Up @@ -290,6 +279,6 @@ class CharacterDataLatin1 extends CharacterData {

static {
$$Initializers
}
}
}

6 changes: 2 additions & 4 deletions src/java.base/share/classes/java/lang/Character.java
Original file line number Diff line number Diff line change
Expand Up @@ -9495,8 +9495,7 @@ public static boolean isLowerCase(char ch) {
* @since 1.5
*/
public static boolean isLowerCase(int codePoint) {
return CharacterData.of(codePoint).isLowerCase(codePoint) ||
CharacterData.of(codePoint).isOtherLowercase(codePoint);
return CharacterData.of(codePoint).isLowerCase(codePoint);
}

/**
Expand Down Expand Up @@ -9561,8 +9560,7 @@ public static boolean isUpperCase(char ch) {
* @since 1.5
*/
public static boolean isUpperCase(int codePoint) {
return CharacterData.of(codePoint).isUpperCase(codePoint) ||
CharacterData.of(codePoint).isOtherUppercase(codePoint);
return CharacterData.of(codePoint).isUpperCase(codePoint);
}

/**
Expand Down
8 changes: 0 additions & 8 deletions src/java.base/share/classes/java/lang/CharacterData.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ char[] toUpperCaseCharArray(int ch) {
return null;
}

boolean isOtherLowercase(int ch) {
return false;
}

boolean isOtherUppercase(int ch) {
return false;
}

boolean isOtherAlphabetic(int ch) {
return false;
}
Expand Down