-
Bug
-
Resolution: Duplicate
-
P4
-
8, 11
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
System:
Ubuntu 22.04.2 LTS on Windows 10 x86_64
Java Runtime Information:
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment 18.9 (build 11.0.12+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Pattern.CASE_INSENSITIVE does not take effect in jdk11, but it can match characters normally when using jdk17
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run included source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Pattern.compile("some\\p{javaLowerCase}*Name", Pattern.CASE_INSENSITIVE) can match the value of "someOtherName"
---------- BEGIN SOURCE ----------
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class BugReport {
public static void main(String[] args) {
Pattern normalisedCamelCasePattern = Pattern.compile("some\\p{javaLowerCase}*Name", Pattern.CASE_INSENSITIVE);
ArrayList<String> candidates = new ArrayList<>();
candidates.add("someName");
candidates.add("someOtherName");
for (String candidate : candidates) {
Matcher matcher = normalisedCamelCasePattern.matcher(candidate);
if (matcher.lookingAt()) {
System.out.println("success:" + candidate);
} else {
System.out.println("fail:" + candidate);
}
}
}
}
---------- END SOURCE ----------
FREQUENCY : rarely
System:
Ubuntu 22.04.2 LTS on Windows 10 x86_64
Java Runtime Information:
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment 18.9 (build 11.0.12+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Pattern.CASE_INSENSITIVE does not take effect in jdk11, but it can match characters normally when using jdk17
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run included source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Pattern.compile("some\\p{javaLowerCase}*Name", Pattern.CASE_INSENSITIVE) can match the value of "someOtherName"
---------- BEGIN SOURCE ----------
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class BugReport {
public static void main(String[] args) {
Pattern normalisedCamelCasePattern = Pattern.compile("some\\p{javaLowerCase}*Name", Pattern.CASE_INSENSITIVE);
ArrayList<String> candidates = new ArrayList<>();
candidates.add("someName");
candidates.add("someOtherName");
for (String candidate : candidates) {
Matcher matcher = normalisedCamelCasePattern.matcher(candidate);
if (matcher.lookingAt()) {
System.out.println("success:" + candidate);
} else {
System.out.println("fail:" + candidate);
}
}
}
}
---------- END SOURCE ----------
FREQUENCY : rarely
- duplicates
-
JDK-8328950 Case insensitive matching doesn't work correctly for some character classes
- Closed
- relates to
-
JDK-8214245 Case insensitive matching doesn't work correctly for some character classes
- Resolved
- links to
-
Review openjdk/jdk11u-dev/2061