You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2008/09/24 12:10:25 UTC

svn commit: r698504 - /harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java

Author: tellison
Date: Wed Sep 24 03:10:25 2008
New Revision: 698504

URL: http://svn.apache.org/viewvc?rev=698504&view=rev
Log:
Formatting change.

Modified:
    harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java

Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java?rev=698504&r1=698503&r2=698504&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java Wed Sep 24 03:10:25 2008
@@ -61,12 +61,12 @@
  * as "java.nio.charset.spi.CharsetProvider" and located in the
  * "META-INF/services" sub folder of one or more classpaths. The files should be
  * encoded in "UTF-8". Each line of their content specifies the class name of a
- * charset provider which extends <code>java.nio.spi.CharsetProvider</code>.
- * A line should ends with '\r', '\n' or '\r\n'. Leading and trailing
- * whitespaces are trimmed. Blank lines, and lines (after trimmed) starting with
- * "#" which are regarded as comments, are both ignored. Duplicates of already
- * appeared names are also ignored. Both the configuration files and the
- * provider classes will be loaded using the thread context class loader.
+ * charset provider which extends <code>java.nio.spi.CharsetProvider</code>. A
+ * line should ends with '\r', '\n' or '\r\n'. Leading and trailing whitespaces
+ * are trimmed. Blank lines, and lines (after trimmed) starting with "#" which
+ * are regarded as comments, are both ignored. Duplicates of already appeared
+ * names are also ignored. Both the configuration files and the provider classes
+ * will be loaded using the thread context class loader.
  * </p>
  * <p>
  * This class is thread-safe.
@@ -122,8 +122,7 @@
     }
 
     /**
-     * Constructs a <code>Charset</code> object. Duplicated aliases are
-     * ignored.
+     * Constructs a <code>Charset</code> object. Duplicated aliases are ignored.
      * 
      * @param canonicalName
      *            the canonical name of the charset
@@ -313,8 +312,8 @@
      * Gets a map of all available charsets supported by the runtime.
      * <p>
      * The returned map contains mappings from canonical names to corresponding
-     * instances of <code>Charset</code>. The canonical names can be
-     * considered as case-insensitive.
+     * instances of <code>Charset</code>. The canonical names can be considered
+     * as case-insensitive.
      * </p>
      * 
      * @return an unmodifiable map of all available charsets supported by the
@@ -619,13 +618,12 @@
      * @return the result of the encoding
      */
     public final ByteBuffer encode(CharBuffer buffer) {
-        try 
-        {
+        try {
             return this.newEncoder()
-                     .onMalformedInput(CodingErrorAction.REPLACE)
-                     .onUnmappableCharacter(CodingErrorAction.REPLACE)
-                     .encode(buffer);
-                                     
+                    .onMalformedInput(CodingErrorAction.REPLACE)
+                    .onUnmappableCharacter(CodingErrorAction.REPLACE).encode(
+                            buffer);
+
         } catch (CharacterCodingException ex) {
             throw new Error(ex.getMessage(), ex);
         }
@@ -660,16 +658,16 @@
      */
     public final CharBuffer decode(ByteBuffer buffer) {
 
-		try {
-			return this.newDecoder()
-					.onMalformedInput(CodingErrorAction.REPLACE)
-					.onUnmappableCharacter(CodingErrorAction.REPLACE)
-					.decode(buffer);
-
-		} catch (CharacterCodingException ex) {
-			throw new Error(ex.getMessage(), ex);
-		}
-	}
+        try {
+            return this.newDecoder()
+                    .onMalformedInput(CodingErrorAction.REPLACE)
+                    .onUnmappableCharacter(CodingErrorAction.REPLACE).decode(
+                            buffer);
+
+        } catch (CharacterCodingException ex) {
+            throw new Error(ex.getMessage(), ex);
+        }
+    }
 
     /*
      * -------------------------------------------------------------------