harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r492652 [13/13] - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/
Date Thu, 04 Jan 2007 17:47:05 GMT
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/UnsupportedEncodingException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/UnsupportedEncodingException.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/UnsupportedEncodingException.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/UnsupportedEncodingException.java
Thu Jan  4 09:47:01 2007
@@ -24,23 +24,22 @@
 public class UnsupportedEncodingException extends IOException {
 
     private static final long serialVersionUID = -4274276298326136670L;
-    
-	/**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 */
-	public UnsupportedEncodingException() {
-		super();
-	}
 
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            the detail message for the exception.
-	 */
-	public UnsupportedEncodingException(String detailMessage) {
-		super(detailMessage);
-	}
+    /**
+     * Constructs a new instance of this class with its walkback filled in.
+     */
+    public UnsupportedEncodingException() {
+        super();
+    }
 
+    /**
+     * Constructs a new instance of this class with its walkback and message
+     * filled in.
+     * 
+     * @param detailMessage
+     *            the detail message for the exception.
+     */
+    public UnsupportedEncodingException(String detailMessage) {
+        super(detailMessage);
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/WriteAbortedException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/WriteAbortedException.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/WriteAbortedException.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/WriteAbortedException.java
Thu Jan  4 09:47:01 2007
@@ -17,7 +17,6 @@
 
 package java.io;
 
-
 /**
  * This type of exception is thrown by readObject() when it detects an exception
  * marker in the input stream. This marker indicates that when the object was
@@ -30,53 +29,53 @@
  */
 public class WriteAbortedException extends ObjectStreamException {
 
-	private static final long serialVersionUID = -3326426625597282442L;
-
-	/**
-	 * The exception that was caused when writeObject() was attempting to
-	 * serialize the object
-	 */
-	public Exception detail;
+    private static final long serialVersionUID = -3326426625597282442L;
 
-	/**
-	 * Constructs a new instance of this class with its walkback, message and
-	 * the exception which caused the underlying problem when serializing the
-	 * object filled in.
-	 * 
-	 * @param detailMessage
-	 *            the detail message for the exception.
-	 * @param rootCause
-	 *            exception that caused the problem when serializing the object.
-	 */
-	public WriteAbortedException(String detailMessage, Exception rootCause) {
-		super(detailMessage);
-		detail = rootCause;
-		initCause(rootCause);
-	}
-
-	/**
-	 * Answers the extra information message which was provided when the
-	 * throwable was created. If no message was provided at creation time, then
-	 * answer null.
-	 * 
-	 * @return the receiver's message.
-	 */
-	@Override
+    /**
+     * The exception that was caused when writeObject() was attempting to
+     * serialize the object
+     */
+    public Exception detail;
+
+    /**
+     * Constructs a new instance of this class with its walkback, message and
+     * the exception which caused the underlying problem when serializing the
+     * object filled in.
+     * 
+     * @param detailMessage
+     *            the detail message for the exception.
+     * @param rootCause
+     *            exception that caused the problem when serializing the object.
+     */
+    public WriteAbortedException(String detailMessage, Exception rootCause) {
+        super(detailMessage);
+        detail = rootCause;
+        initCause(rootCause);
+    }
+
+    /**
+     * Answers the extra information message which was provided when the
+     * throwable was created. If no message was provided at creation time, then
+     * answer null.
+     * 
+     * @return the receiver's message.
+     */
+    @Override
     public String getMessage() {
-		String msg = super.getMessage();
-		if (detail != null) {
-			msg = msg + "; " + detail.toString(); //$NON-NLS-1$
-		}
-		return msg;
-	}
-
-	/**
-	 * Answers the cause of this Throwable, or null if there is no cause.
-	 * 
-	 * @return the receiver's cause.
-	 */
-	@Override
+        String msg = super.getMessage();
+        if (detail != null) {
+            msg = msg + "; " + detail.toString(); //$NON-NLS-1$
+        }
+        return msg;
+    }
+
+    /**
+     * Answers the cause of this Throwable, or null if there is no cause.
+     * 
+     * @return the receiver's cause.
+     */
+    @Override
     public Throwable getCause() {
-		return detail;
-	}
+        return detail;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Writer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Writer.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Writer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Writer.java Thu Jan
 4 09:47:01 2007
@@ -28,13 +28,14 @@
 
     static final String TOKEN_NULL = "null"; //$NON-NLS-1$
 
-    /** The object used to synchronize access to the writer. */
+    /**
+     * The object used to synchronize access to the writer.
+     */
     protected Object lock;
 
     /**
      * Constructs a new character stream Writer using <code>this</code> as the
      * Object to synchronize critical regions around.
-     * 
      */
     protected Writer() {
         super();
@@ -49,11 +50,10 @@
      *            the Object to synchronize critical regions around.
      */
     protected Writer(Object lock) {
-        if (lock != null) {
-            this.lock = lock;
-        } else {
+        if (lock == null) {
             throw new NullPointerException();
         }
+        this.lock = lock;
     }
 
     /**
@@ -159,16 +159,15 @@
      *             If offset or count are outside of bounds.
      */
     public void write(String str, int offset, int count) throws IOException {
-        if (count >= 0) { // other cases tested by getChars()
-            char buf[] = new char[count];
-            str.getChars(offset, offset + count, buf, 0);
-
-            synchronized (lock) {
-                write(buf);
-            }
-        } else {
+        if (count < 0) { // other cases tested by getChars()
             throw new StringIndexOutOfBoundsException();
         }
+        char buf[] = new char[count];
+        str.getChars(offset, offset + count, buf, 0);
+
+        synchronized (lock) {
+            write(buf);
+        }
     }
 
     /**
@@ -239,5 +238,4 @@
         }
         return this;
     }
-
 }



Mime
View raw message