Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 77125 invoked from network); 10 Oct 2005 17:22:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Oct 2005 17:22:37 -0000 Received: (qmail 81799 invoked by uid 500); 10 Oct 2005 17:22:36 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 81746 invoked by uid 500); 10 Oct 2005 17:22:34 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 81735 invoked by uid 500); 10 Oct 2005 17:22:34 -0000 Received: (qmail 81732 invoked by uid 99); 10 Oct 2005 17:22:34 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 10 Oct 2005 10:22:34 -0700 Received: (qmail 76948 invoked by uid 65534); 10 Oct 2005 17:22:14 -0000 Message-ID: <20051010172214.76947.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r312690 - in /jakarta/commons/proper/configuration/trunk: src/java/org/apache/commons/configuration/PropertiesConfiguration.java src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java xdocs/changes.xml Date: Mon, 10 Oct 2005 17:22:13 -0000 To: commons-cvs@jakarta.apache.org From: ebourg@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ebourg Date: Mon Oct 10 10:22:05 2005 New Revision: 312690 URL: http://svn.apache.org/viewcvs?rev=312690&view=rev Log: PropertiesConfiguration now translates properly the escaped unicode characters (like \u1234) used in the property keys (Bug 36991) Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java jakarta/commons/proper/configuration/trunk/xdocs/changes.xml Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java?rev=312690&r1=312689&r2=312690&view=diff ============================================================================== --- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java (original) +++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java Mon Oct 10 10:22:05 2005 @@ -347,7 +347,7 @@ } else { - addProperty(key, unescapeJava(value, getDelimiter())); + addProperty(StringEscapeUtils.unescapeJava(key), unescapeJava(value, getDelimiter())); } } Modified: jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java?rev=312690&r1=312689&r2=312690&view=diff ============================================================================== --- jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java (original) +++ jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java Mon Oct 10 10:22:05 2005 @@ -1,5 +1,3 @@ -package org.apache.commons.configuration; - /* * Copyright 2001-2005 The Apache Software Foundation. * @@ -16,16 +14,12 @@ * limitations under the License. */ +package org.apache.commons.configuration; + import java.io.File; import java.io.FileWriter; import java.io.PrintWriter; -import java.io.PipedOutputStream; -import java.io.PipedInputStream; -import java.io.ObjectOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.FileInputStream; +import java.io.StringReader; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -309,6 +303,14 @@ public void testUnescapeJava() { assertEquals("test\\,test", PropertiesConfiguration.unescapeJava("test\\,test", ',')); + } + + public void testEscapedKey() throws Exception + { + PropertiesConfiguration conf = new PropertiesConfiguration(); + conf.load(new StringReader("\\u0066\\u006f\\u006f=bar")); + + assertEquals("value of the 'foo' property", "bar", conf.getString("foo")); } public void testMixedArray() Modified: jakarta/commons/proper/configuration/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/xdocs/changes.xml?rev=312690&r1=312689&r2=312690&view=diff ============================================================================== --- jakarta/commons/proper/configuration/trunk/xdocs/changes.xml (original) +++ jakarta/commons/proper/configuration/trunk/xdocs/changes.xml Mon Oct 10 10:22:05 2005 @@ -23,6 +23,11 @@ + + PropertiesConfiguration now translates properly the escaped unicode + characters (like \u1234) used in the property keys. This complies with + the specification of java.util.Properties. + ConfigurationConverter.getProperties() now uses the delimiter of the specified configuration to convert the list properties into strings. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org