directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r225199 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/util/MutableString.java
Date Mon, 25 Jul 2005 22:48:38 GMT
Author: elecharny
Date: Mon Jul 25 15:48:35 2005
New Revision: 225199

URL: http://svn.apache.org/viewcvs?rev=225199&view=rev
Log:
- Added a method to get the MutableString's length
- the length member is now transient

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/util/MutableString.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/util/MutableString.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/util/MutableString.java?rev=225199&r1=225198&r2=225199&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/util/MutableString.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/util/MutableString.java
Mon Jul 25 15:48:35 2005
@@ -27,7 +27,7 @@
     private char[] string;
     
     /** Actual length of the string */
-    private transient int length;
+    private int length;
     
     /** A null MutableString */
     public transient static final MutableString EMPTY_STRING = new MutableString();
@@ -101,8 +101,7 @@
     {
         length = StringUtils.countChars(bytes);
         
-        string = new char[bytes.length];
-        this.length = bytes.length;
+        string = new char[length];
         
         int pos = 0;
         
@@ -113,6 +112,14 @@
         }
     }
     
+    /**
+     * @return Returns the length.
+     */
+    public int getLength() 
+    {
+        return length;
+    }
+
     /**
      * Return a native String representation of the MutableString.
      */



Mime
View raw message