[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/29619] New: Non-conformant String.replaceAll (String Stri
From: |
mwfong at csl dot sri dot com |
Subject: |
[Bug classpath/29619] New: Non-conformant String.replaceAll (String String) |
Date: |
27 Oct 2006 18:10:03 -0000 |
GNU classpath's String.replaceAll (String, String) implementation
produces different results from Sun's.
Simple Test
------ ----
public class gijReplaceAll {
public static void main(String[] args) {
String testString = "what-we-have here";
String replString = testString.replaceAll ("(([^a-zA-z0-9% >:]))",
"\\\\$1");
System.err.println ("\"" + testString + "\" " +
replString.length() + ": \"" + replString + "\"");
}
}
Sun JRE 1.4.2 (Correct)
--- --- ----- ---------
$ java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
$ java -classpath . gijReplaceAll
"what-we-have here" 19: "what\-we\-have here"
gij/classpath (Erroneous)
------------- -----------
$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ java -classpath . gijReplaceAll
"what-we-have here" 21: "what\\-we\\-have here"
--
Summary: Non-conformant String.replaceAll (String String)
Product: classpath
Version: 0.92
Status: UNCONFIRMED
Severity: blocker
Priority: P3
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mwfong at csl dot sri dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29619
- [Bug classpath/29619] New: Non-conformant String.replaceAll (String String),
mwfong at csl dot sri dot com <=