jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r415660 - /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java
Date Tue, 20 Jun 2006 14:34:27 GMT
Author: jukka
Date: Tue Jun 20 07:34:27 2006
New Revision: 415660

URL: http://svn.apache.org/viewvc?rev=415660&view=rev
Log:
Text.java: Fixed a bug in unescapeIllegalJcrChars() and added some javadocs

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java?rev=415660&r1=415659&r2=415660&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java Tue Jun
20 07:34:27 2006
@@ -440,7 +440,10 @@
 
     /**
      * Escapes all illegal JCR name characters of a string.
-     * use {@link #unescapeIllegalJcrChars(String)} for decoding.
+     * The encoding is loosely modeled after URI encoding, but only encodes
+     * the characters it absolutely needs to in order to make the resulting
+     * string a valid JCR name.
+     * Use {@link #unescapeIllegalJcrChars(String)} for decoding.
      * <p/>
      * QName EBNF:<br>
      * <xmp>
@@ -493,7 +496,7 @@
             int a = Character.digit(name.charAt(i + 1), 16);
             int b = Character.digit(name.charAt(i + 2), 16);
             if (a > -1 && b > -1) {
-                buffer.append((char) a * 16 + b);
+                buffer.append((char) (a * 16 + b));
                 name = name.substring(i + 3);
             } else {
                 buffer.append('%');



Mime
View raw message