[ https://issues.apache.org/jira/browse/HARMONY-3145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexey Petrenko reassigned HARMONY-3145:
----------------------------------------
Assignee: Alexey Petrenko
> [regex] java.util.regex.Pattern failed to compile "(\\P{all})+" pattern unlike RI
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-3145
> URL: https://issues.apache.org/jira/browse/HARMONY-3145
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Evgeniya Maenkova
> Assigned To: Alexey Petrenko
> Attachments: Pattern1.java, regex.patch
>
>
> The test is: [to be attached]
> import java.util.regex.Pattern;
> public class Pattern1 {
> public static void main(String[] args) throws Exception {
> int[] codePoint = new int[1];
> Pattern p = Pattern.compile("(\\p{all})+");
> boolean res = true;
> int cnt = 0;
> String s;
> for (int i =0; i < 0x110000; i ++) {
> codePoint[0] = i;
> s = new String(codePoint, 0, 1);
> if (!s.matches(p.toString())) {
> cnt++;
> res = false;
> }
> }
> System.out.println(res + " " + Integer.toHexString(cnt));
>
> p = Pattern.compile("(\\P{all})+");
> res = true;
> cnt = 0;
>
> for (int i =0; i < 0x110000; i ++) {
> codePoint[0] = i;
> s = new String(codePoint, 0, 1);
> if (!s.matches(p.toString())) {
> cnt++;
> res = false;
> }
> }
>
>
> System.out.println(res + " " + Integer.toHexString(cnt));
>
> }
> }
> DRL output:
> Uncaught exception in main:
> java.util.regex.PatternSyntaxException: Character Class \p{all} is not supported near
index: 8
> (\p{all})+
> ^
> at java.util.regex.Lexer.movePointer(Lexer.java:564)
> at java.util.regex.Lexer.<init>(Lexer.java:225)
> at java.util.regex.Pattern.compileImpl(Pattern.java:279)
> at java.util.regex.Pattern.compile(Pattern.java:264)
> at java.util.regex.Pattern.compile(Pattern.java)
> at Pattern1.main(Pattern1.java:5)
> RI output:
> true 0
> false 110000
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
|