You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Evgeniya Maenkova (JIRA)" <ji...@apache.org> on 2007/02/08 19:44:05 UTC

[jira] Updated: (HARMONY-3145) [regex] java.util.regex.Pattern failed to compile "(\\P{all})+" pattern unlike RI

     [ https://issues.apache.org/jira/browse/HARMONY-3145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeniya Maenkova updated HARMONY-3145:
---------------------------------------

    Attachment: Pattern1.java

test

> [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
>         Attachments: Pattern1.java
>
>
> 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.