harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r433041 [11/13] - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang: ./ ref/ reflect/
Date Sun, 20 Aug 2006 20:54:31 GMT
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=433041&r1=433040&r2=433041&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 Sun Aug 20 13:54:27 2006
@@ -1,753 +1,753 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * <p>
- * A modifiable {@link CharSequence sequence of characters} for use in creating
- * and modifying Strings. This class is intended as a direct replacement of
- * {@link java.lang.StringBuffer} for non-concurrent use; unlike
- * <code>StringBuffer</code> this class is not synchronized for thread safety.
- * </p>
- * 
- * <p>
- * The majority of the modification methods on this class return
- * <code>StringBuilder</code>, so that, like <code>StringBuffer</code>s,
- * they can be used in chaining method calls together. For example,
- * <code>new StringBuilder("One should ").append("always strive ").append("to achieve Harmony")</code>.
- * </p>
- * 
- * @see java.lang.CharSequence
- * @see java.lang.Appendable
- * @see java.lang.StringBuffer
- * @see java.lang.String
- * 
- * @since 1.5
- */
-public final class StringBuilder extends AbstractStringBuilder implements
-        Appendable, CharSequence, Serializable {
-
-    private static final long serialVersionUID = 4383685877147921099L;
-
-    /**
-     * <p>
-     * Constructs an instance with an initial capacity of <code>16</code>.
-     * </p>
-     * 
-     * @see #capacity()
-     */
-    public StringBuilder() {
-        super();
-    }
-
-    /**
-     * <p>
-     * Constructs an instance with a specified capacity.
-     * </p>
-     * 
-     * @param capacity The initial capacity to use.
-     * 
-     * @throws NegativeArraySizeException if the <code>capacity</code>
-     *         parameter is <code>null</code>.
-     * 
-     * @see #capacity()
-     */
-    public StringBuilder(int capacity) {
-        super(capacity);
-    }
-
-    /**
-     * <p>
-     * Constructs an instance that's populated by a {@link CharSequence}. The
-     * capacity of the new builder will bee the length of the
-     * <code>CharSequence</code> plus 16.
-     * </p>
-     * 
-     * @param seq The <code>CharSequence</code> to copy into the builder.
-     * @throws NullPointerException if the <code>seq</code> parameter is
-     *         <code>null</code>.
-     */
-    public StringBuilder(CharSequence seq) {
-        super(seq.toString());
-    }
-
-    /**
-     * <p>
-     * Constructs an instance that's populated by a {@link String}. The
-     * capacity of the new builder will bee the length of the
-     * <code>String</code> plus 16.
-     * </p>
-     * 
-     * @param str The <code>String</code> to copy into the builder.
-     * @throws NullPointerException if the <code>str</code> parameter is
-     *         <code>null</code>.
-     */
-    public StringBuilder(String str) {
-        super(str);
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>boolean</code> value
-     * passed. The <code>boolean</code> value is converted to a String
-     * according to the rule defined by {@link String#valueOf(boolean)}.
-     * </p>
-     * 
-     * @param b The <code>boolean</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(boolean)
-     */
-    public StringBuilder append(boolean b) {
-        append0(b ? "true" : "false");
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>char</code> value
-     * passed. The <code>char</code> value is converted to a String according
-     * to the rule defined by {@link String#valueOf(char)}.
-     * </p>
-     * 
-     * @param c The <code>char</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(char)
-     */
-    public StringBuilder append(char c) {
-        append0(c);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>int</code> value passed.
-     * The <code>int</code> value is converted to a String according to the
-     * rule defined by {@link String#valueOf(int)}.
-     * </p>
-     * 
-     * @param i The <code>int</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(int)
-     */
-    public StringBuilder append(int i) {
-        append0(Integer.toString(i));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>long</code> value
-     * passed. The <code>long</code> value is converted to a String according
-     * to the rule defined by {@link String#valueOf(long)}.
-     * </p>
-     * 
-     * @param lng The <code>long</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(long)
-     */
-    public StringBuilder append(long lng) {
-        append0(Long.toString(lng));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>float</code> value
-     * passed. The <code>float</code> value is converted to a String according
-     * to the rule defined by {@link String#valueOf(float)}.
-     * </p>
-     * 
-     * @param f The <code>float</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(float)
-     */
-    public StringBuilder append(float f) {
-        append0(Float.toString(f));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>double</code> value
-     * passed. The <code>double</code> value is converted to a String
-     * according to the rule defined by {@link String#valueOf(double)}.
-     * </p>
-     * 
-     * @param d The <code>double</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(double)
-     */
-    public StringBuilder append(double d) {
-        append0(Double.toString(d));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>Object</code> value
-     * passed. The <code>Object</code> value is converted to a String
-     * according to the rule defined by {@link String#valueOf(Object)}.
-     * </p>
-     * 
-     * @param obj The <code>Object</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(Object)
-     */
-    public StringBuilder append(Object obj) {
-        if (obj == null) {
-            appendNull();
-        } else {
-            append0(obj.toString());
-        }
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the contents of the String. If the String passed is
-     * <code>null</code>, then the String <code>"null"</code> is appended.
-     * </p>
-     * 
-     * @param str The String to append to this object.
-     * @return A reference to this object.
-     */
-    public StringBuilder append(String str) {
-        append0(str);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the contents of the StringBuffer. If the StringBuffer passed is
-     * <code>null</code>, then the StringBuffer <code>"null"</code> is
-     * appended.
-     * </p>
-     * 
-     * @param sb The StringBuffer to append to this object.
-     * @return A reference to this object.
-     */
-    public StringBuilder append(StringBuffer sb) {
-        if (sb == null) {
-            appendNull();
-        } else {
-            append0(sb.getValue(), 0, sb.length());
-        }
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>char[]</code> value
-     * passed. The <code>char[]</code> value is converted to a String
-     * according to the rule defined by {@link String#valueOf(char[])}.
-     * </p>
-     * 
-     * @param str The <code>char[]</code> value to append to this object.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(char[])
-     */
-    public StringBuilder append(char[] ch) {
-        append0(ch);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the subset of the
-     * <code>char[]</code> value passed. The <code>char[]</code> value is
-     * converted to a String according to the rule defined by
-     * {@link String#valueOf(char[],int,int)}.
-     * </p>
-     * 
-     * @param str The <code>char[]</code> value to append to this object.
-     * @param offset The inclusive offset index to begin copying from the
-     *        <code>str</code> parameter.
-     * @param len The number of character to copy from the <code>str</code>
-     *        parameter.
-     * @return A reference to this object.
-     * 
-     * @see String#valueOf(char[],int,int)
-     */
-    public StringBuilder append(char[] str, int offset, int len) {
-        append0(str, offset, len);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the <code>CharSequence</code>
-     * value passed. If the <code>CharSequence</code> is <code>null</code>,
-     * then the String <code>"null"</code> is appended.
-     * </p>
-     * 
-     * @param csq The <code>CharSequence</code> value to append to this
-     *        object.
-     * @return A reference to this object.
-     */
-    public StringBuilder append(CharSequence csq) {
-        if (csq == null) {
-            appendNull();
-        } else {
-            append0(csq.toString());
-        }
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the String representation of the subsequence of the
-     * <code>CharSequence</code> value passed. If the
-     * <code>CharSequence</code> is <code>null</code>, then the String
-     * <code>"null"</code> is used to extract the subsequence from.
-     * </p>
-     * 
-     * @param csq The <code>CharSequence</code> value to append to this
-     *        object.
-     * @param start The beginning index of the subsequence.
-     * @param end The ending index of the subsequence.
-     * @return A reference to this object.
-     */
-    public StringBuilder append(CharSequence csq, int start, int end) {
-        append0(csq, start, end);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Appends the encoded Unicode code point to this object. The code point is
-     * converted to a <code>char[]</code> as defined by
-     * {@link Character#toChars(int)}.
-     * </p>
-     * 
-     * @param codePoint The Unicode code point to encode and append.
-     * @return A reference to this object.
-     * @see Character#toChars(int)
-     */
-    public StringBuilder appendCodePoint(int codePoint) {
-        append0(Character.toChars(codePoint));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Deletes a sequence of characters within this object, shifts any remaining
-     * characters to the left and adjusts the {@link #length()} of this object.
-     * </p>
-     * 
-     * @param start The inclusive start index to begin deletion.
-     * @param end The exclusive end index to stop deletion.
-     * @return A reference to this object.
-     * @throws StringIndexOutOfBoundsException if <code>start</code> is less
-     *         than zero, greater than the current length or greater than
-     *         <code>end</code>.
-     */
-    public StringBuilder delete(int start, int end) {
-        delete0(start, end);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Deletes a single character within this object, shifts any remaining
-     * characters to the left and adjusts the {@link #length()} of this object.
-     * </p>
-     * 
-     * @param index The index of the character to delete.
-     * @return A reference to this object.
-     * @throws StringIndexOutOfBoundsException if <code>index</code> is less
-     *         than zero or is greater than or equal to the current length.
-     */
-    public StringBuilder deleteCharAt(int index) {
-        deleteCharAt0(index);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>boolean</code> value
-     * passed into this object at the <code>offset</code> passed. The
-     * <code>boolean</code> value is converted to a String according to the
-     * rule defined by {@link String#valueOf(boolean)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param b The <code>boolean</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(boolean)
-     */
-    public StringBuilder insert(int offset, boolean b) {
-        insert0(offset, b ? "true" : "false");
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>char</code> value passed
-     * into this object at the <code>offset</code> passed. The
-     * <code>char</code> value is converted to a String according to the rule
-     * defined by {@link String#valueOf(char)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param c The <code>char</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws ArrayIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(char)
-     */
-    public StringBuilder insert(int offset, char c) {
-        insert0(offset, c);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>int</code> value passed
-     * into this object at the <code>offset</code> passed. The
-     * <code>int</code> value is converted to a String according to the rule
-     * defined by {@link String#valueOf(int)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param b The <code>int</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(int)
-     */
-    public StringBuilder insert(int offset, int i) {
-        insert0(offset, Integer.toString(i));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>long</code> value passed
-     * into this object at the <code>offset</code> passed. The
-     * <code>long</code> value is converted to a String according to the rule
-     * defined by {@link String#valueOf(long)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param b The <code>long</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(long)
-     */
-    public StringBuilder insert(int offset, long l) {
-        insert0(offset, Long.toString(l));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>float</code> value
-     * passed into this object at the <code>offset</code> passed. The
-     * <code>float</code> value is converted to a String according to the rule
-     * defined by {@link String#valueOf(float)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param b The <code>float</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(float)
-     */
-    public StringBuilder insert(int offset, float f) {
-        insert0(offset, Float.toString(f));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>double</code> value
-     * passed into this object at the <code>offset</code> passed. The
-     * <code>double</code> value is converted to a String according to the
-     * rule defined by {@link String#valueOf(double)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param d The <code>double</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(double)
-     */
-    public StringBuilder insert(int offset, double d) {
-        insert0(offset, Double.toString(d));
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>Object</code> value
-     * passed into this object at the <code>offset</code> passed. The
-     * <code>Object</code> value is converted to a String according to the
-     * rule defined by {@link String#valueOf(Object)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param b The <code>Object</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(Object)
-     */
-    public StringBuilder insert(int offset, Object obj) {
-        insert0(offset, obj == null ? "null" : obj.toString());
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String value passed into this object at the
-     * <code>offset</code> passed. If the String parameter is null, then the
-     * String <code>"null"</code> is inserted.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param str The String to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     */
-    public StringBuilder insert(int offset, String str) {
-        insert0(offset, str);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>char[]</code> value
-     * passed into this object at the <code>offset</code> passed. The
-     * <code>char[]</code> value is converted to a String according to the
-     * rule defined by {@link String#valueOf(char[])}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param ch The <code>char[]</code> value to insert into this object.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(char[])
-     */
-    public StringBuilder insert(int offset, char[] ch) {
-        insert0(offset, ch);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the subsequence of the
-     * <code>char[]</code> value passed into this object at the
-     * <code>offset</code> passed. The <code>char[]</code> value is
-     * converted to a String according to the rule defined by
-     * {@link String#valueOf(char[],int,int)}.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param str The <code>char[]</code> value to insert into this object.
-     * @param strOffset The inclusive index of the <code>str</code> parameter
-     *        to start copying from.
-     * @param strLen The number of characters to copy from the <code>str</code>
-     *        parameter.
-     * @return A reference to this object.
-     * 
-     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
-     *         negative or greater than the current {@link #length()}.
-     * 
-     * @see String#valueOf(char[],int,int)
-     */
-    public StringBuilder insert(int offset, char[] str, int strOffset,
-            int strLen) {
-        insert0(offset, str, strOffset, strLen);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the <code>CharSequence</code>
-     * value passed into this object at the <code>offset</code> passed. The
-     * <code>CharSequence</code> value is converted to a String as defined by
-     * {@link CharSequence#toString()}. If the <code>CharSequence</code> is
-     * <code>null</code>, then the String <code>"null"</code> is inserted.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param s The <code>CharSequence</code> value to insert into this
-     *        object.
-     * @return A reference to this object.
-     * 
-     * @throws IndexOutOfBoundsException if <code>offset</code> is negative or
-     *         greater than the current {@link #length()}.
-     * 
-     * @see CharSequence#toString()
-     */
-    public StringBuilder insert(int offset, CharSequence s) {
-        insert0(offset, s == null ? "null" : s.toString());
-        return this;
-    }
-
-    /**
-     * <p>
-     * Inserts the String representation of the subsequence of the
-     * <code>CharSequence</code> value passed into this object at the
-     * <code>offset</code> passed. The <code>CharSequence</code> value is
-     * converted to a String as defined by
-     * {@link CharSequence#subSequence(int, int)}. If the
-     * <code>CharSequence</code> is <code>null</code>, then the String
-     * <code>"null"</code> is used to determine the subsequence.
-     * </p>
-     * 
-     * @param offset The index of this object to insert the value.
-     * @param s The <code>CharSequence</code> value to insert into this
-     *        object.
-     * @param start The start of the subsequence of the <code>s</code>
-     *        parameter.
-     * @param end The end of the subsequence of the <code>s</code> parameter.
-     * @return A reference to this object.
-     * 
-     * @throws IndexOutOfBoundsException if <code>offset</code> is negative or
-     *         greater than the current {@link #length()}.
-     * 
-     * @see CharSequence#subSequence(int, int)
-     */
-    public StringBuilder insert(int offset, CharSequence s, int start, int end) {
-        insert0(offset, s, start, end);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Replaces the indicated subsequence of this object with the String passed.
-     * If the String passed is longer or shorter than the subsequence, then this
-     * object will be adjusted appropriately.
-     * </p>
-     * 
-     * @param start The inclusive start index of the sequence to replace in this
-     *        object.
-     * @param end The exclusive end index of the sequence to replace in this
-     *        object.
-     * @param str The String to replace the subsequence.
-     * @return A reference to this object.
-     * @throws StringIndexOutOfBoundsException if <code>start</code> is
-     *         negative, greater than the current {@link #length()} or greater
-     *         than <code>end</code>.
-     * @throws NullPointerException if the <code>str</code> parameter is
-     *         <code>null</code>.
-     */
-    public StringBuilder replace(int start, int end, String str) {
-        replace0(start, end, str);
-        return this;
-    }
-
-    /**
-     * <p>
-     * Reverses the contents of this object.
-     * </p>
-     * 
-     * @return A reference to this object.
-     */
-    public StringBuilder reverse() {
-        reverse0();
-        return this;
-    }
-
-    /**
-     * Answers the contents of this StringBuilder.
-     * 
-     * @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
-         * reference to the non-public AbstractStringBuilder if we don't
-         * override it here.
-         */
-        return super.toString();
-    }
-
-    /**
-     * <p>
-     * Reads the state of a <code>StringBuilder</code> from the passed stream
-     * and restores it to this instance.
-     * </p>
-     * 
-     * @param in The stream to read the state from.
-     * @throws IOException if the stream throws it during the read.
-     * @throws ClassNotFoundException if the stream throws it during the read.
-     */
-    private void readObject(ObjectInputStream in) throws IOException,
-            ClassNotFoundException {
-        in.defaultReadObject();
-        int count = in.readInt();
-        char[] value = (char[]) in.readObject();
-        set(value, count);
-    }
-
-    /**
-     * <p>
-     * Writes the state of this object to the stream passed.
-     * </p>
-     * 
-     * @param out The stream to write the state to.
-     * @throws IOException if the stream throws it during the write.
-     * @serialData <code>int</code> - The length of this object.
-     *             <code>char[]</code> - The buffer from this object, which
-     *             may be larger than the length field.
-     */
-    private void writeObject(ObjectOutputStream out) throws IOException {
-        out.defaultWriteObject();
-        out.writeInt(length());
-        out.writeObject(getValue());
-    }
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package java.lang;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * A modifiable {@link CharSequence sequence of characters} for use in creating
+ * and modifying Strings. This class is intended as a direct replacement of
+ * {@link java.lang.StringBuffer} for non-concurrent use; unlike
+ * <code>StringBuffer</code> this class is not synchronized for thread safety.
+ * </p>
+ * 
+ * <p>
+ * The majority of the modification methods on this class return
+ * <code>StringBuilder</code>, so that, like <code>StringBuffer</code>s,
+ * they can be used in chaining method calls together. For example,
+ * <code>new StringBuilder("One should ").append("always strive ").append("to achieve Harmony")</code>.
+ * </p>
+ * 
+ * @see java.lang.CharSequence
+ * @see java.lang.Appendable
+ * @see java.lang.StringBuffer
+ * @see java.lang.String
+ * 
+ * @since 1.5
+ */
+public final class StringBuilder extends AbstractStringBuilder implements
+        Appendable, CharSequence, Serializable {
+
+    private static final long serialVersionUID = 4383685877147921099L;
+
+    /**
+     * <p>
+     * Constructs an instance with an initial capacity of <code>16</code>.
+     * </p>
+     * 
+     * @see #capacity()
+     */
+    public StringBuilder() {
+        super();
+    }
+
+    /**
+     * <p>
+     * Constructs an instance with a specified capacity.
+     * </p>
+     * 
+     * @param capacity The initial capacity to use.
+     * 
+     * @throws NegativeArraySizeException if the <code>capacity</code>
+     *         parameter is <code>null</code>.
+     * 
+     * @see #capacity()
+     */
+    public StringBuilder(int capacity) {
+        super(capacity);
+    }
+
+    /**
+     * <p>
+     * Constructs an instance that's populated by a {@link CharSequence}. The
+     * capacity of the new builder will bee the length of the
+     * <code>CharSequence</code> plus 16.
+     * </p>
+     * 
+     * @param seq The <code>CharSequence</code> to copy into the builder.
+     * @throws NullPointerException if the <code>seq</code> parameter is
+     *         <code>null</code>.
+     */
+    public StringBuilder(CharSequence seq) {
+        super(seq.toString());
+    }
+
+    /**
+     * <p>
+     * Constructs an instance that's populated by a {@link String}. The
+     * capacity of the new builder will bee the length of the
+     * <code>String</code> plus 16.
+     * </p>
+     * 
+     * @param str The <code>String</code> to copy into the builder.
+     * @throws NullPointerException if the <code>str</code> parameter is
+     *         <code>null</code>.
+     */
+    public StringBuilder(String str) {
+        super(str);
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>boolean</code> value
+     * passed. The <code>boolean</code> value is converted to a String
+     * according to the rule defined by {@link String#valueOf(boolean)}.
+     * </p>
+     * 
+     * @param b The <code>boolean</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(boolean)
+     */
+    public StringBuilder append(boolean b) {
+        append0(b ? "true" : "false");
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>char</code> value
+     * passed. The <code>char</code> value is converted to a String according
+     * to the rule defined by {@link String#valueOf(char)}.
+     * </p>
+     * 
+     * @param c The <code>char</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(char)
+     */
+    public StringBuilder append(char c) {
+        append0(c);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>int</code> value passed.
+     * The <code>int</code> value is converted to a String according to the
+     * rule defined by {@link String#valueOf(int)}.
+     * </p>
+     * 
+     * @param i The <code>int</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(int)
+     */
+    public StringBuilder append(int i) {
+        append0(Integer.toString(i));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>long</code> value
+     * passed. The <code>long</code> value is converted to a String according
+     * to the rule defined by {@link String#valueOf(long)}.
+     * </p>
+     * 
+     * @param lng The <code>long</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(long)
+     */
+    public StringBuilder append(long lng) {
+        append0(Long.toString(lng));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>float</code> value
+     * passed. The <code>float</code> value is converted to a String according
+     * to the rule defined by {@link String#valueOf(float)}.
+     * </p>
+     * 
+     * @param f The <code>float</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(float)
+     */
+    public StringBuilder append(float f) {
+        append0(Float.toString(f));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>double</code> value
+     * passed. The <code>double</code> value is converted to a String
+     * according to the rule defined by {@link String#valueOf(double)}.
+     * </p>
+     * 
+     * @param d The <code>double</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(double)
+     */
+    public StringBuilder append(double d) {
+        append0(Double.toString(d));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>Object</code> value
+     * passed. The <code>Object</code> value is converted to a String
+     * according to the rule defined by {@link String#valueOf(Object)}.
+     * </p>
+     * 
+     * @param obj The <code>Object</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(Object)
+     */
+    public StringBuilder append(Object obj) {
+        if (obj == null) {
+            appendNull();
+        } else {
+            append0(obj.toString());
+        }
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the contents of the String. If the String passed is
+     * <code>null</code>, then the String <code>"null"</code> is appended.
+     * </p>
+     * 
+     * @param str The String to append to this object.
+     * @return A reference to this object.
+     */
+    public StringBuilder append(String str) {
+        append0(str);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the contents of the StringBuffer. If the StringBuffer passed is
+     * <code>null</code>, then the StringBuffer <code>"null"</code> is
+     * appended.
+     * </p>
+     * 
+     * @param sb The StringBuffer to append to this object.
+     * @return A reference to this object.
+     */
+    public StringBuilder append(StringBuffer sb) {
+        if (sb == null) {
+            appendNull();
+        } else {
+            append0(sb.getValue(), 0, sb.length());
+        }
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>char[]</code> value
+     * passed. The <code>char[]</code> value is converted to a String
+     * according to the rule defined by {@link String#valueOf(char[])}.
+     * </p>
+     * 
+     * @param str The <code>char[]</code> value to append to this object.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(char[])
+     */
+    public StringBuilder append(char[] ch) {
+        append0(ch);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the subset of the
+     * <code>char[]</code> value passed. The <code>char[]</code> value is
+     * converted to a String according to the rule defined by
+     * {@link String#valueOf(char[],int,int)}.
+     * </p>
+     * 
+     * @param str The <code>char[]</code> value to append to this object.
+     * @param offset The inclusive offset index to begin copying from the
+     *        <code>str</code> parameter.
+     * @param len The number of character to copy from the <code>str</code>
+     *        parameter.
+     * @return A reference to this object.
+     * 
+     * @see String#valueOf(char[],int,int)
+     */
+    public StringBuilder append(char[] str, int offset, int len) {
+        append0(str, offset, len);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the <code>CharSequence</code>
+     * value passed. If the <code>CharSequence</code> is <code>null</code>,
+     * then the String <code>"null"</code> is appended.
+     * </p>
+     * 
+     * @param csq The <code>CharSequence</code> value to append to this
+     *        object.
+     * @return A reference to this object.
+     */
+    public StringBuilder append(CharSequence csq) {
+        if (csq == null) {
+            appendNull();
+        } else {
+            append0(csq.toString());
+        }
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the String representation of the subsequence of the
+     * <code>CharSequence</code> value passed. If the
+     * <code>CharSequence</code> is <code>null</code>, then the String
+     * <code>"null"</code> is used to extract the subsequence from.
+     * </p>
+     * 
+     * @param csq The <code>CharSequence</code> value to append to this
+     *        object.
+     * @param start The beginning index of the subsequence.
+     * @param end The ending index of the subsequence.
+     * @return A reference to this object.
+     */
+    public StringBuilder append(CharSequence csq, int start, int end) {
+        append0(csq, start, end);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Appends the encoded Unicode code point to this object. The code point is
+     * converted to a <code>char[]</code> as defined by
+     * {@link Character#toChars(int)}.
+     * </p>
+     * 
+     * @param codePoint The Unicode code point to encode and append.
+     * @return A reference to this object.
+     * @see Character#toChars(int)
+     */
+    public StringBuilder appendCodePoint(int codePoint) {
+        append0(Character.toChars(codePoint));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Deletes a sequence of characters within this object, shifts any remaining
+     * characters to the left and adjusts the {@link #length()} of this object.
+     * </p>
+     * 
+     * @param start The inclusive start index to begin deletion.
+     * @param end The exclusive end index to stop deletion.
+     * @return A reference to this object.
+     * @throws StringIndexOutOfBoundsException if <code>start</code> is less
+     *         than zero, greater than the current length or greater than
+     *         <code>end</code>.
+     */
+    public StringBuilder delete(int start, int end) {
+        delete0(start, end);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Deletes a single character within this object, shifts any remaining
+     * characters to the left and adjusts the {@link #length()} of this object.
+     * </p>
+     * 
+     * @param index The index of the character to delete.
+     * @return A reference to this object.
+     * @throws StringIndexOutOfBoundsException if <code>index</code> is less
+     *         than zero or is greater than or equal to the current length.
+     */
+    public StringBuilder deleteCharAt(int index) {
+        deleteCharAt0(index);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>boolean</code> value
+     * passed into this object at the <code>offset</code> passed. The
+     * <code>boolean</code> value is converted to a String according to the
+     * rule defined by {@link String#valueOf(boolean)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param b The <code>boolean</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(boolean)
+     */
+    public StringBuilder insert(int offset, boolean b) {
+        insert0(offset, b ? "true" : "false");
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>char</code> value passed
+     * into this object at the <code>offset</code> passed. The
+     * <code>char</code> value is converted to a String according to the rule
+     * defined by {@link String#valueOf(char)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param c The <code>char</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws ArrayIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(char)
+     */
+    public StringBuilder insert(int offset, char c) {
+        insert0(offset, c);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>int</code> value passed
+     * into this object at the <code>offset</code> passed. The
+     * <code>int</code> value is converted to a String according to the rule
+     * defined by {@link String#valueOf(int)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param b The <code>int</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(int)
+     */
+    public StringBuilder insert(int offset, int i) {
+        insert0(offset, Integer.toString(i));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>long</code> value passed
+     * into this object at the <code>offset</code> passed. The
+     * <code>long</code> value is converted to a String according to the rule
+     * defined by {@link String#valueOf(long)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param b The <code>long</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(long)
+     */
+    public StringBuilder insert(int offset, long l) {
+        insert0(offset, Long.toString(l));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>float</code> value
+     * passed into this object at the <code>offset</code> passed. The
+     * <code>float</code> value is converted to a String according to the rule
+     * defined by {@link String#valueOf(float)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param b The <code>float</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(float)
+     */
+    public StringBuilder insert(int offset, float f) {
+        insert0(offset, Float.toString(f));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>double</code> value
+     * passed into this object at the <code>offset</code> passed. The
+     * <code>double</code> value is converted to a String according to the
+     * rule defined by {@link String#valueOf(double)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param d The <code>double</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(double)
+     */
+    public StringBuilder insert(int offset, double d) {
+        insert0(offset, Double.toString(d));
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>Object</code> value
+     * passed into this object at the <code>offset</code> passed. The
+     * <code>Object</code> value is converted to a String according to the
+     * rule defined by {@link String#valueOf(Object)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param b The <code>Object</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(Object)
+     */
+    public StringBuilder insert(int offset, Object obj) {
+        insert0(offset, obj == null ? "null" : obj.toString());
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String value passed into this object at the
+     * <code>offset</code> passed. If the String parameter is null, then the
+     * String <code>"null"</code> is inserted.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param str The String to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     */
+    public StringBuilder insert(int offset, String str) {
+        insert0(offset, str);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>char[]</code> value
+     * passed into this object at the <code>offset</code> passed. The
+     * <code>char[]</code> value is converted to a String according to the
+     * rule defined by {@link String#valueOf(char[])}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param ch The <code>char[]</code> value to insert into this object.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(char[])
+     */
+    public StringBuilder insert(int offset, char[] ch) {
+        insert0(offset, ch);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the subsequence of the
+     * <code>char[]</code> value passed into this object at the
+     * <code>offset</code> passed. The <code>char[]</code> value is
+     * converted to a String according to the rule defined by
+     * {@link String#valueOf(char[],int,int)}.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param str The <code>char[]</code> value to insert into this object.
+     * @param strOffset The inclusive index of the <code>str</code> parameter
+     *        to start copying from.
+     * @param strLen The number of characters to copy from the <code>str</code>
+     *        parameter.
+     * @return A reference to this object.
+     * 
+     * @throws StringIndexOutOfBoundsException if <code>offset</code> is
+     *         negative or greater than the current {@link #length()}.
+     * 
+     * @see String#valueOf(char[],int,int)
+     */
+    public StringBuilder insert(int offset, char[] str, int strOffset,
+            int strLen) {
+        insert0(offset, str, strOffset, strLen);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the <code>CharSequence</code>
+     * value passed into this object at the <code>offset</code> passed. The
+     * <code>CharSequence</code> value is converted to a String as defined by
+     * {@link CharSequence#toString()}. If the <code>CharSequence</code> is
+     * <code>null</code>, then the String <code>"null"</code> is inserted.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param s The <code>CharSequence</code> value to insert into this
+     *        object.
+     * @return A reference to this object.
+     * 
+     * @throws IndexOutOfBoundsException if <code>offset</code> is negative or
+     *         greater than the current {@link #length()}.
+     * 
+     * @see CharSequence#toString()
+     */
+    public StringBuilder insert(int offset, CharSequence s) {
+        insert0(offset, s == null ? "null" : s.toString());
+        return this;
+    }
+
+    /**
+     * <p>
+     * Inserts the String representation of the subsequence of the
+     * <code>CharSequence</code> value passed into this object at the
+     * <code>offset</code> passed. The <code>CharSequence</code> value is
+     * converted to a String as defined by
+     * {@link CharSequence#subSequence(int, int)}. If the
+     * <code>CharSequence</code> is <code>null</code>, then the String
+     * <code>"null"</code> is used to determine the subsequence.
+     * </p>
+     * 
+     * @param offset The index of this object to insert the value.
+     * @param s The <code>CharSequence</code> value to insert into this
+     *        object.
+     * @param start The start of the subsequence of the <code>s</code>
+     *        parameter.
+     * @param end The end of the subsequence of the <code>s</code> parameter.
+     * @return A reference to this object.
+     * 
+     * @throws IndexOutOfBoundsException if <code>offset</code> is negative or
+     *         greater than the current {@link #length()}.
+     * 
+     * @see CharSequence#subSequence(int, int)
+     */
+    public StringBuilder insert(int offset, CharSequence s, int start, int end) {
+        insert0(offset, s, start, end);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Replaces the indicated subsequence of this object with the String passed.
+     * If the String passed is longer or shorter than the subsequence, then this
+     * object will be adjusted appropriately.
+     * </p>
+     * 
+     * @param start The inclusive start index of the sequence to replace in this
+     *        object.
+     * @param end The exclusive end index of the sequence to replace in this
+     *        object.
+     * @param str The String to replace the subsequence.
+     * @return A reference to this object.
+     * @throws StringIndexOutOfBoundsException if <code>start</code> is
+     *         negative, greater than the current {@link #length()} or greater
+     *         than <code>end</code>.
+     * @throws NullPointerException if the <code>str</code> parameter is
+     *         <code>null</code>.
+     */
+    public StringBuilder replace(int start, int end, String str) {
+        replace0(start, end, str);
+        return this;
+    }
+
+    /**
+     * <p>
+     * Reverses the contents of this object.
+     * </p>
+     * 
+     * @return A reference to this object.
+     */
+    public StringBuilder reverse() {
+        reverse0();
+        return this;
+    }
+
+    /**
+     * Answers the contents of this StringBuilder.
+     * 
+     * @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
+         * reference to the non-public AbstractStringBuilder if we don't
+         * override it here.
+         */
+        return super.toString();
+    }
+
+    /**
+     * <p>
+     * Reads the state of a <code>StringBuilder</code> from the passed stream
+     * and restores it to this instance.
+     * </p>
+     * 
+     * @param in The stream to read the state from.
+     * @throws IOException if the stream throws it during the read.
+     * @throws ClassNotFoundException if the stream throws it during the read.
+     */
+    private void readObject(ObjectInputStream in) throws IOException,
+            ClassNotFoundException {
+        in.defaultReadObject();
+        int count = in.readInt();
+        char[] value = (char[]) in.readObject();
+        set(value, count);
+    }
+
+    /**
+     * <p>
+     * Writes the state of this object to the stream passed.
+     * </p>
+     * 
+     * @param out The stream to write the state to.
+     * @throws IOException if the stream throws it during the write.
+     * @serialData <code>int</code> - The length of this object.
+     *             <code>char[]</code> - The buffer from this object, which
+     *             may be larger than the length field.
+     */
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        out.defaultWriteObject();
+        out.writeInt(length());
+        out.writeObject(getValue());
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java Sun Aug 20 13:54:27 2006
@@ -1,58 +1,58 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-
-import org.apache.harmony.luni.util.Msg;
-
-/**
- * This runtime exception is thrown when the a String is indexed with a value
- * less than zero, or greater than or equal to the size of the array.
- */
-public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
-
-    private static final long serialVersionUID = -6762910422159637258L;
-
-    /**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public StringIndexOutOfBoundsException() {
-		super();
-	}
-
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * (which is based on the argument which is the index which failed) filled
-	 * in.
-	 * 
-	 * @param index
-	 *            int the index which is out of bounds
-	 */
-	public StringIndexOutOfBoundsException(int index) {
-		super(Msg.getString("K0055", index));
-	}
-
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            String The detail message for the exception.
-	 */
-	public StringIndexOutOfBoundsException(String detailMessage) {
-		super(detailMessage);
-	}
-}
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+import org.apache.harmony.luni.util.Msg;
+
+/**
+ * This runtime exception is thrown when the a String is indexed with a value
+ * less than zero, or greater than or equal to the size of the array.
+ */
+public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
+
+    private static final long serialVersionUID = -6762910422159637258L;
+
+    /**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public StringIndexOutOfBoundsException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * (which is based on the argument which is the index which failed) filled
+	 * in.
+	 * 
+	 * @param index
+	 *            int the index which is out of bounds
+	 */
+	public StringIndexOutOfBoundsException(int index) {
+		super(Msg.getString("K0055", index));
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public StringIndexOutOfBoundsException(String detailMessage) {
+		super(detailMessage);
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadDeath.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadDeath.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadDeath.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadDeath.java Sun Aug 20 13:54:27 2006
@@ -1,34 +1,34 @@
-/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-
-/**
- * ThreadDeath is thrown when a thread stops executing. It is used to aid in the
- * orderly unrolling of the thread's stack (eg. cleanup of monitors).
- */
-public class ThreadDeath extends Error {
-
-    private static final long serialVersionUID = -4417128565033088268L;
-
-    /**
-	 * Constructs a new instance of this class. Note that in the case of
-	 * ThreadDeath, the walkback may <em>not</em> be filled in a way which
-	 * allows a stack trace to be printed.
-	 */
-	public ThreadDeath() {
-	}
-}
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * ThreadDeath is thrown when a thread stops executing. It is used to aid in the
+ * orderly unrolling of the thread's stack (eg. cleanup of monitors).
+ */
+public class ThreadDeath extends Error {
+
+    private static final long serialVersionUID = -4417128565033088268L;
+
+    /**
+	 * Constructs a new instance of this class. Note that in the case of
+	 * ThreadDeath, the walkback may <em>not</em> be filled in a way which
+	 * allows a stack trace to be printed.
+	 */
+	public ThreadDeath() {
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadDeath.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java Sun Aug 20 13:54:27 2006
@@ -1,72 +1,72 @@
-/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-/**
- * A ThreadLocal is a variable that has a per-thread value. Different Threads
- * may reference the same ThreadLocal object, but the values they observe will
- * not be <code>==</code>. This provides Thread local storage.
- * 
- * @see java.lang.Thread
- */
-public class ThreadLocal<T> {
-    /**
-     * Constructs a new ThreadLocal object
-     */
-    public ThreadLocal() {
-        super();
-    }
-
-    /**
-     * Return the value of this variable under
-     * <code>Thread.currentThread()</code>
-     */
-    @SuppressWarnings("unchecked")
-    public T get() {
-        return (T) Thread.currentThread().getThreadLocal(this);
-    }
-
-    /**
-     * Return the initial value of this variable under
-     * <code>Thread.currentThread()</code>
-     */
-    protected T initialValue() {
-        return null;
-    }
-
-    /**
-     * Set the value of this variable under <code>Thread.currentThread()</code>
-     */
-    public void set(T value) {
-        Thread.currentThread().setThreadLocal(this, value);
-    }
-
-    /**
-     * <p>
-     * Removes the current value, such that the next call to {@link #get()} will
-     * return the default value, as defined by {@link #initialValue()}.
-     * </p>
-     * 
-     * @since 1.5
-     */
-    public void remove() {
-        /*
-         * TODO Consider adding an explicit removeThreadLocal method to Thread
-         * for VM implementations to take advantage of extra possible space.
-         */
-        Thread.currentThread().setThreadLocal(this, initialValue());
-    }
-}
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+/**
+ * A ThreadLocal is a variable that has a per-thread value. Different Threads
+ * may reference the same ThreadLocal object, but the values they observe will
+ * not be <code>==</code>. This provides Thread local storage.
+ * 
+ * @see java.lang.Thread
+ */
+public class ThreadLocal<T> {
+    /**
+     * Constructs a new ThreadLocal object
+     */
+    public ThreadLocal() {
+        super();
+    }
+
+    /**
+     * Return the value of this variable under
+     * <code>Thread.currentThread()</code>
+     */
+    @SuppressWarnings("unchecked")
+    public T get() {
+        return (T) Thread.currentThread().getThreadLocal(this);
+    }
+
+    /**
+     * Return the initial value of this variable under
+     * <code>Thread.currentThread()</code>
+     */
+    protected T initialValue() {
+        return null;
+    }
+
+    /**
+     * Set the value of this variable under <code>Thread.currentThread()</code>
+     */
+    public void set(T value) {
+        Thread.currentThread().setThreadLocal(this, value);
+    }
+
+    /**
+     * <p>
+     * Removes the current value, such that the next call to {@link #get()} will
+     * return the default value, as defined by {@link #initialValue()}.
+     * </p>
+     * 
+     * @since 1.5
+     */
+    public void remove() {
+        /*
+         * TODO Consider adding an explicit removeThreadLocal method to Thread
+         * for VM implementations to take advantage of extra possible space.
+         */
+        Thread.currentThread().setThreadLocal(this, initialValue());
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnknownError.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnknownError.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnknownError.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnknownError.java Sun Aug 20 13:54:27 2006
@@ -1,44 +1,44 @@
-/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-
-/**
- * This error is thrown when the virtual machine must throw an error which does
- * not match any known exceptional condition.
- */
-public class UnknownError extends VirtualMachineError {
-
-    private static final long serialVersionUID = 2524784860676771849L;
-
-    /**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public UnknownError() {
-		super();
-	}
-
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            String The detail message for the exception.
-	 */
-	public UnknownError(String detailMessage) {
-		super(detailMessage);
-	}
-}
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when the virtual machine must throw an error which does
+ * not match any known exceptional condition.
+ */
+public class UnknownError extends VirtualMachineError {
+
+    private static final long serialVersionUID = 2524784860676771849L;
+
+    /**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public UnknownError() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public UnknownError(String detailMessage) {
+		super(detailMessage);
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnknownError.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsatisfiedLinkError.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsatisfiedLinkError.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsatisfiedLinkError.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsatisfiedLinkError.java Sun Aug 20 13:54:27 2006
@@ -1,44 +1,44 @@
-/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-
-/**
- * This error is thrown when an attempt is made to invoke a native for which an
- * implementation could not be found.
- */
-public class UnsatisfiedLinkError extends LinkageError {
-
-    private static final long serialVersionUID = -4019343241616879428L;
-
-    /**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public UnsatisfiedLinkError() {
-		super();
-	}
-
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            String The detail message for the exception.
-	 */
-	public UnsatisfiedLinkError(String detailMessage) {
-		super(detailMessage);
-	}
-}
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when an attempt is made to invoke a native for which an
+ * implementation could not be found.
+ */
+public class UnsatisfiedLinkError extends LinkageError {
+
+    private static final long serialVersionUID = -4019343241616879428L;
+
+    /**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public UnsatisfiedLinkError() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public UnsatisfiedLinkError(String detailMessage) {
+		super(detailMessage);
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsatisfiedLinkError.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedClassVersionError.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedClassVersionError.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedClassVersionError.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedClassVersionError.java Sun Aug 20 13:54:27 2006
@@ -1,44 +1,44 @@
-/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-
-/**
- * This error is thrown when an attempt is made to load a class with a format
- * version that is not supported by the VM.
- */
-public class UnsupportedClassVersionError extends ClassFormatError {
-
-    private static final long serialVersionUID = -7123279212883497373L;
-
-    /**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public UnsupportedClassVersionError() {
-		super();
-	}
-
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            String The detail message for the exception.
-	 */
-	public UnsupportedClassVersionError(String detailMessage) {
-		super(detailMessage);
-	}
-}
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when an attempt is made to load a class with a format
+ * version that is not supported by the VM.
+ */
+public class UnsupportedClassVersionError extends ClassFormatError {
+
+    private static final long serialVersionUID = -7123279212883497373L;
+
+    /**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public UnsupportedClassVersionError() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public UnsupportedClassVersionError(String detailMessage) {
+		super(detailMessage);
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedClassVersionError.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedOperationException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedOperationException.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedOperationException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedOperationException.java Sun Aug 20 13:54:27 2006
@@ -1,61 +1,61 @@
-/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-
-/**
- * This runtime exception is thrown when an unsupported operation is attempted.
- */
-public class UnsupportedOperationException extends RuntimeException {
-
-	private static final long serialVersionUID = -1242599979055084673L;
-
-	/**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public UnsupportedOperationException() {
-	}
-
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            String The detail message for the exception.
-	 */
-	public UnsupportedOperationException(String detailMessage) {
-		super(detailMessage);
-	}
-    
-    /**
-     * <p>Constructs a new instance with a message and cause.</p>
-     * @param message The message to assign to this exception.
-     * @param cause The optional cause of this exception; may be <code>null</code>.
-     * @since 1.5
-     */
-    public UnsupportedOperationException(String message, Throwable cause) {
-        super(message, cause);
-    }
-    
-    /**
-     * <p>Constructs a new instance with a cause.</p>
-     * @param cause The optional cause of this exception; may be <code>null</code>.
-     * @since 1.5
-     */
-    public UnsupportedOperationException(Throwable cause) {
-        super((cause == null ? null : cause.toString()), cause);
-    }
-}
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when an unsupported operation is attempted.
+ */
+public class UnsupportedOperationException extends RuntimeException {
+
+	private static final long serialVersionUID = -1242599979055084673L;
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public UnsupportedOperationException() {
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public UnsupportedOperationException(String detailMessage) {
+		super(detailMessage);
+	}
+    
+    /**
+     * <p>Constructs a new instance with a message and cause.</p>
+     * @param message The message to assign to this exception.
+     * @param cause The optional cause of this exception; may be <code>null</code>.
+     * @since 1.5
+     */
+    public UnsupportedOperationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+    /**
+     * <p>Constructs a new instance with a cause.</p>
+     * @param cause The optional cause of this exception; may be <code>null</code>.
+     * @since 1.5
+     */
+    public UnsupportedOperationException(Throwable cause) {
+        super((cause == null ? null : cause.toString()), cause);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/UnsupportedOperationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/VerifyError.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/VerifyError.java?rev=433041&r1=433040&r2=433041&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/VerifyError.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/VerifyError.java Sun Aug 20 13:54:27 2006
@@ -1,44 +1,44 @@
-/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-
-/**
- * This error is thrown when the VM notices that an attempt is made to load a
- * class which does not pass the class verification phase.
- */
-public class VerifyError extends LinkageError {
-
-    private static final long serialVersionUID = 7001962396098498785L;
-
-    /**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public VerifyError() {
-		super();
-	}
-
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            String The detail message for the exception.
-	 */
-	public VerifyError(String detailMessage) {
-		super(detailMessage);
-	}
-}
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when the VM notices that an attempt is made to load a
+ * class which does not pass the class verification phase.
+ */
+public class VerifyError extends LinkageError {
+
+    private static final long serialVersionUID = 7001962396098498785L;
+
+    /**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public VerifyError() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public VerifyError(String detailMessage) {
+		super(detailMessage);
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/VerifyError.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message