commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-cp] [bugs #11962] java.util.regex.Matcher.group(int) differs fro


From: anonymous
Subject: [commit-cp] [bugs #11962] java.util.regex.Matcher.group(int) differs from Sun's API
Date: Sun, 13 Feb 2005 14:40:03 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050110 Firefox/1.0 (Debian package 1.0+dfsg.1-2)

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11962>

                 Summary: java.util.regex.Matcher.group(int) differs from
Sun's API
                 Project: classpath
            Submitted by: None
            Submitted on: Sun 02/13/2005 at 14:40
                Category: classpath
                Severity: 5 - Average
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
        Platform Version: None

    _______________________________________________________

Details:



According to Sun's API documentation, java.util.regex.Matcher.group(int)
returns null if the specified group didn't match. This isn't mentioned in the
documentation of the respective method in Classpath 0.13. Further, the
implementation is to return gnu.regexp.REMatch.toString(group), which is an
empty string in this situation.



There is also a related internal inconsistency in Classpath resulting from
this implementation, because REMatch.toString(int) doesn't throw the
exception that Match.group(int) promises in case the group doesn't exist in
the pattern.



Attached is a test program that prints two OKs on Sun's JDK

1.5.0 and two shoulds on Kaffe 1.1.4 and Sablevm 1.1.9.







    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 02/13/2005 at 14:40  Name: MatcherBug.java  Size: 781B   By: None
test program
<http://savannah.gnu.org/bugs/download.php?item_id=11962&item_file_id=2190>

    _______________________________________________________

This item URL is:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11962>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]