harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r430230 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang: AbstractStringBuilder.java StringBuffer.java StringBuilder.java
Date Thu, 10 Aug 2006 03:41:02 GMT
Author: ndbeyer
Date: Wed Aug  9 20:41:02 2006
New Revision: 430230

URL: http://svn.apache.org/viewvc?rev=430230&view=rev
Log:
Code cleanup, remove warnings, etc for StringBuffer.java, StringBuilder.java and AbstractStringBuilder.java.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuffer.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuilder.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java?rev=430230&r1=430229&r2=430230&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
Wed Aug  9 20:41:02 2006
@@ -102,7 +102,7 @@
         if (newSize > value.length) {
             enlargeBuffer(newSize);
         } else if (shared) {
-            value = (char[]) value.clone();
+            value = value.clone();
             shared = false;
         }
         value[count++] = 'n';
@@ -116,7 +116,7 @@
         if (newSize > value.length) {
             enlargeBuffer(newSize);
         } else if (shared) {
-            value = (char[]) value.clone();
+            value = value.clone();
             shared = false;
         }
         System.arraycopy(chars, 0, value, count, chars.length);
@@ -133,7 +133,7 @@
             if (newSize > value.length) {
                 enlargeBuffer(newSize);
             } else if (shared) {
-                value = (char[]) value.clone();
+                value = value.clone();
                 shared = false;
             }
             System.arraycopy(chars, start, value, count, length);
@@ -148,7 +148,7 @@
             enlargeBuffer(count + 1);
         }
         if (shared) {
-            value = (char[]) value.clone();
+            value = value.clone();
             shared = false;
         }
         value[count++] = ch;
@@ -164,7 +164,7 @@
         if (newSize > value.length) {
             enlargeBuffer(newSize);
         } else if (shared) {
-            value = (char[]) value.clone();
+            value = value.clone();
             shared = false;
         }
         string.getChars(0, adding, value, count);
@@ -422,7 +422,7 @@
                     // replacing with more characters...need some room
                     move(-diff, end);
                 } else if (shared) {
-                    value = (char[]) value.clone();
+                    value = value.clone();
                     shared = false;
                 }
                 string.getChars(0, stringLength, value, start);
@@ -474,7 +474,7 @@
             throw new StringIndexOutOfBoundsException(index);
         }
         if (shared) {
-            value = (char[]) value.clone();
+            value = value.clone();
             shared = false;
         }
         value[index] = ch;
@@ -566,6 +566,7 @@
      * 
      * @return a String containing the characters in this StringBuilder.
      */
+    @Override
     public String toString() {
         if (count == 0)
             return "";

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuffer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuffer.java?rev=430230&r1=430229&r2=430230&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuffer.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuffer.java
Wed Aug  9 20:41:02 2006
@@ -169,10 +169,11 @@
      * @return this StringBuffer
      */
     public synchronized StringBuffer append(Object obj) {
-        if (obj == null)
+        if (obj == null) {
             appendNull();
-        else
+        } else {
             append0(obj.toString());
+        }
         return this;
     }
 
@@ -250,10 +251,11 @@
      * @since 1.5
      */
     public synchronized StringBuffer append(CharSequence s) {
-        if (s == null)
+        if (s == null) {
             appendNull();
-        else
+        } else {
             append0(s.toString());
+        }
         return this;
     }
 
@@ -306,6 +308,7 @@
      * @throws IndexOutOfBoundsException when <code>index < 0</code> or
      *         <code>index >= length()</code>
      */
+    @Override
     public synchronized char charAt(int index) {
         return super.charAt(index);
     }
@@ -324,6 +327,7 @@
      * @see Character#codePointAt(char[], int, int)
      * @since 1.5
      */
+    @Override
     public synchronized int codePointAt(int index) {
         return super.codePointAt(index);
     }
@@ -343,6 +347,7 @@
      * @see Character#codePointBefore(char[], int, int)
      * @since 1.5
      */
+    @Override
     public synchronized int codePointBefore(int index) {
         return super.codePointBefore(index);
     }
@@ -361,6 +366,7 @@
      *         <code>endIndex</code> is greater than {@link #length()}.
      * @since 1.5
      */
+    @Override
     public synchronized int codePointCount(int beginIndex, int endIndex) {
         return super.codePointCount(beginIndex, endIndex);
     }
@@ -402,6 +408,7 @@
      * @param min the minimum number of elements that this StringBuffer will
      *        hold before growing
      */
+    @Override
     public synchronized void ensureCapacity(int min) {
         super.ensureCapacity(min);
     }
@@ -419,6 +426,7 @@
      *				start > end, index < 0, end - start > buffer.length - index</code>
      * @throws NullPointerException when buffer is null
      */
+    @Override
     public synchronized void getChars(int start, int end, char[] buffer, int idx) {
         super.getChars(start, end, buffer, idx);
     }
@@ -437,6 +445,7 @@
      * 
      * @since 1.4
      */
+    @Override
     public synchronized int indexOf(String subString, int start) {
         return super.indexOf(subString, start);
     }
@@ -658,6 +667,7 @@
      * 
      * @since 1.4
      */
+    @Override
     public synchronized int lastIndexOf(String subString, int start) {
         return super.lastIndexOf(subString, start);
     }
@@ -677,6 +687,7 @@
      *         <code>codePointOffset</code>.
      * @since 1.5
      */
+    @Override
     public synchronized int offsetByCodePoints(int index, int codePointOffset) {
         return super.offsetByCodePoints(index, codePointOffset);
     }
@@ -717,6 +728,7 @@
      * @throws IndexOutOfBoundsException when <code>index < 0</code> or
      *         <code>index >= length()</code>
      */
+    @Override
     public synchronized void setCharAt(int index, char ch) {
         super.setCharAt(index, ch);
     }
@@ -733,6 +745,7 @@
      * 
      * @see #length
      */
+    @Override
     public synchronized void setLength(int length) {
         super.setLength(length);
     }
@@ -750,6 +763,7 @@
      * 
      * @since 1.4
      */
+    @Override
     public synchronized CharSequence subSequence(int start, int end) {
         return super.substring(start, end);
     }
@@ -764,6 +778,7 @@
      * @throws StringIndexOutOfBoundsException when <code>start < 0</code>
or
      *         <code>start > length()</code>
      */
+    @Override
     public synchronized String substring(int start) {
         return super.substring(start);
     }
@@ -779,6 +794,7 @@
      *         <code>start < 0, start > end</code> or
      *         <code>end > length()</code>
      */
+    @Override
     public synchronized String substring(int start, int end) {
         return super.substring(start, end);
     }
@@ -788,6 +804,7 @@
      * 
      * @return a String containing the characters in this StringBuffer
      */
+    @Override
     public synchronized String toString() {
         return super.toString();
     }
@@ -801,6 +818,7 @@
      * 
      * @since 1.5
      */
+    @Override
     public synchronized void trimToSize() {
         super.trimToSize();
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuilder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuilder.java?rev=430230&r1=430229&r2=430230&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuilder.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuilder.java
Wed Aug  9 20:41:02 2006
@@ -220,10 +220,11 @@
      * @see String#valueOf(Object)
      */
     public StringBuilder append(Object obj) {
-        if (obj == null)
+        if (obj == null) {
             appendNull();
-        else
+        } else {
             append0(obj.toString());
+        }
         return this;
     }
 
@@ -311,10 +312,11 @@
      * @return A reference to this object.
      */
     public StringBuilder append(CharSequence csq) {
-        if (csq == null)
+        if (csq == null) {
             appendNull();
-        else
+        } else {
             append0(csq.toString());
+        }
         return this;
     }
 
@@ -704,6 +706,7 @@
      * 
      * @return a String containing the characters in this StringBuilder
      */
+    @Override
     public String toString() {
         /* Note: This method is required to workaround a compiler bug
          * in the RI javac (at least in 1.5.0_06) that will generate a



Mime
View raw message