DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17707>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17707

ArrayIndexOutOfBoundsException in Perl5Matcher.contains

           Summary: ArrayIndexOutOfBoundsException in Perl5Matcher.contains
           Product: ORO
           Version: 2.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Main
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


the following code causes exception.

import org.apache.oro.text.regex.MatchResult;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcherInput;
import org.apache.oro.text.regex.Perl5Compiler;
import org.apache.oro.text.regex.Perl5Matcher;

public class OroBug
{       
        public static void main(String[] args)
        {
                try
                {
                        // string containing (but on exclusivly) an 8bit char
                        String src = "n�";
                        // expression using ^ and *
                        String exp = "[^x]*";
                        
                        // set up matcher
                        Perl5Compiler compiler = new Perl5Compiler();
                        Pattern pattern = compiler.compile(exp, 
Perl5Compiler.CASE_INSENSITIVE_MASK);
                        PatternMatcherInput input = new PatternMatcherInput(src);
                        Perl5Matcher matcher = new Perl5Matcher();
                        
                        // throws ArrayIndexOutOfBounds exception
                        matcher.contains(input, pattern);
                }
                catch(Throwable e)
                {
                        System.out.println(e.getClass().getName() + " : " + 
e.getMessage());
                        e.printStackTrace();
                }
        }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to