From commits-return-7039-apmail-commons-commits-archive=commons.apache.org@commons.apache.org Sun Jun 21 05:35:25 2009 Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 10763 invoked from network); 21 Jun 2009 05:35:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jun 2009 05:35:25 -0000 Received: (qmail 60617 invoked by uid 500); 21 Jun 2009 05:35:36 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 60511 invoked by uid 500); 21 Jun 2009 05:35:35 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 60502 invoked by uid 99); 21 Jun 2009 05:35:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Jun 2009 05:35:35 +0000 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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Jun 2009 05:35:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5809F23888C8; Sun, 21 Jun 2009 05:35:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r786942 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/StringEscapeUtils.java test/org/apache/commons/lang/StringEscapeUtilsTest.java Date: Sun, 21 Jun 2009 05:35:05 -0000 To: commits@commons.apache.org From: bayard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090621053505.5809F23888C8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bayard Date: Sun Jun 21 05:35:04 2009 New Revision: 786942 URL: http://svn.apache.org/viewvc?rev=786942&view=rev Log: Removing escapeSql per LANG-493 Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java?rev=786942&r1=786941&r2=786942&view=diff ============================================================================== --- commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java (original) +++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java Sun Jun 21 05:35:04 2009 @@ -666,32 +666,6 @@ } //----------------------------------------------------------------------- - /** - *

Escapes the characters in a String to be suitable to pass to - * an SQL query.

- * - *

For example, - *

statement.executeQuery("SELECT * FROM MOVIES WHERE TITLE='" + 
-     *   StringEscapeUtils.escapeSql("McHale's Navy") + 
-     *   "'");
- *

- * - *

At present, this method only turns single-quotes into doubled single-quotes - * ("McHale's Navy" => "McHale''s Navy"). It does not - * handle the cases of percent (%) or underscore (_) for use in LIKE clauses.

- * - * see http://www.jguru.com/faq/view.jsp?EID=8881 - * @param str the string to escape, may be null - * @return a new String, escaped for SQL, null if null string input - */ - public static String escapeSql(String str) { - if (str == null) { - return null; - } - return StringUtils.replace(str, "'", "''"); - } - - //----------------------------------------------------------------------- /** *

Returns a String value for a CSV column enclosed in double quotes, Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java?rev=786942&r1=786941&r2=786942&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java Sun Jun 21 05:35:04 2009 @@ -324,17 +324,6 @@ assertEquals("XML was unescaped incorrectly", "", sw.toString() ); } - // SQL - // see http://www.jguru.com/faq/view.jsp?EID=8881 - //-------------------- - - public void testEscapeSql() throws Exception - { - assertEquals("don''t stop", StringEscapeUtils.escapeSql("don't stop")); - assertEquals("", StringEscapeUtils.escapeSql("")); - assertEquals(null, StringEscapeUtils.escapeSql(null)); - } - // Tests issue #38569 // http://issues.apache.org/bugzilla/show_bug.cgi?id=38569 public void testStandaloneAmphersand() {