Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 75371 invoked from network); 2 Apr 2008 15:47:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2008 15:47:59 -0000 Received: (qmail 44314 invoked by uid 500); 2 Apr 2008 15:47:58 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 44228 invoked by uid 500); 2 Apr 2008 15:47:57 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 44192 invoked by uid 99); 2 Apr 2008 15:47:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 08:47:57 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 15:47:14 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 48D11234C0BB for ; Wed, 2 Apr 2008 08:45:27 -0700 (PDT) Message-ID: <66636617.1207151127297.JavaMail.jira@brutus> Date: Wed, 2 Apr 2008 08:45:27 -0700 (PDT) From: "Steve Hanmann (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (LANG-421) StringEscapeUtils.escapeJava(String) escapes '/' characters In-Reply-To: <968788942.1207151011344.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steve Hanmann updated LANG-421: ------------------------------- Attachment: StringEscapeUtilsTest.java I attached the JUnit3 test as a file, after I noticed the inline test didn't retain end-of-lines. > StringEscapeUtils.escapeJava(String) escapes '/' characters > ----------------------------------------------------------- > > Key: LANG-421 > URL: https://issues.apache.org/jira/browse/LANG-421 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 2.4 > Reporter: Steve Hanmann > Priority: Blocker > Attachments: StringEscapeUtilsTest.java > > > Commons Lang 2.4 StringEscapeUtils.escapeJava(String) now escapes '/' characters, which is not a valid "escapable" character in Java strings. I haven't tried the other Java escape/unescape methods to see if they have a similar problem, or that only Java "escapable" characters are escaped by escapeJava(String). > This bug may have appeared as an unintended side-effect of the fix for LANG-363. > Also the javadoc for escapeJava is now a little off, in that '/' should now be included in the sentence describing the differences between Java and Javascript strings, with respect to escaping rules. > The following is a JUnit3 test demonstrating the bug. > import junit.framework.TestCase; > import org.apache.commons.lang.StringEscapeUtils; > public class StringEscapeUtilsTest extends TestCase { > public void testEscapeJavaWithSlash() { > final String input = "String with a slash (/) in it"; > > final String expected = input; > final String actual = StringEscapeUtils.escapeJava( input ); > /** > * In 2.4 StringEscapeUtils.escapeJava(String) escapes '/' characters, > * which are not a valid character to escape in a Java string. > */ > assertEquals( expected, actual ); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.