harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-352) tests/api/java/util/regex/PatternSyntaxExceptionTest is excluded
Date Tue, 18 Apr 2006 09:55:19 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-352?page=comments#action_12374887 ] 

Nikolay Kuznetsov commented on HARMONY-352:
-------------------------------------------

> Finally, it fixes the index in the exception thrown for one of the tests in order to
match the RI behaviour.
+++ modules/regex/src/main/java/java/util/regex/Pattern.java	(working copy)
@@ -592,7 +592,7 @@
                     if (lexemes.peek() != Lexer.CHAR_RIGHT_PARENTHESIS)
                         throw new PatternSyntaxException(I18n
                                 .getMessage("unmatched ("), lexemes.toString(),
-                                lexemes.getIndex());
+                                lexemes.getIndex()-1);

I'm a bit concerned about this fix. This one result in incorrect output for all the case except
one under test. The actual cause of incorrect index is that pattern moves index after last
index of the pattern string is already read(fix for indices):

+++ modules/regex/src/main/java/java/util/regex/Pattern.java	(working copy)
@@ -733,6 +733,8 @@
                         term = new RangeSet(cc);
                     } else if (!lexemes.isEmpty()) {
                         term = new CharSet((char) ch);
+                    } else {
+                        break;
                     }

Since this fix interfere with HARMONY-350 fix, let me comment on it also, and I'll provide
separate fix for this problem.


> tests/api/java/util/regex/PatternSyntaxExceptionTest is excluded
> ----------------------------------------------------------------
>
>          Key: HARMONY-352
>          URL: http://issues.apache.org/jira/browse/HARMONY-352
>      Project: Harmony
>         Type: Improvement

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Mikhail Loenko
>     Priority: Trivial
>  Attachments: fix.patternsyntaxexceptiontest.diff
>
> tests/api/java/util/regex/PatternSyntaxExceptionTest is currently excluded because it
was testing for incorrect behaviour.  This should be fixed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message