harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r440655 - in /incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java: java/nio/charset/ org/apache/harmony/niochar/internal/nls/
Date Wed, 06 Sep 2006 08:33:38 GMT
Author: pyang
Date: Wed Sep  6 01:33:37 2006
New Revision: 440655

URL: http://svn.apache.org/viewvc?view=rev&rev=440655
Log:
Updated patch applied for HARMONY-1318 ([classlib][internationalization]Internationalization
of the nio_char module)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetDecoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/org/apache/harmony/niochar/internal/nls/messages.properties

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetDecoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetDecoder.java?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetDecoder.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetDecoder.java
Wed Sep  6 01:33:37 2006
@@ -768,12 +768,14 @@
 	 */
 	public final CharsetDecoder replaceWith(String newReplacement) {
 		if (null == newReplacement || newReplacement.length() == 0) {
+            // niochar.06=Replacement string cannot be null or empty.
 			throw new IllegalArgumentException(
-					"Replacement string cannot be null or empty."); //$NON-NLS-1$
+					Messages.getString("niochar.06"));  //$NON-NLS-1$
 		}
 		if (newReplacement.length() > maxChars) {
+            // niochar.07=Replacement string's length cannot be larger than max characters
per byte.
 			throw new IllegalArgumentException(
-					"Replacement string's length cannot be larger than max characters per byte."); //$NON-NLS-1$
+					Messages.getString("niochar.07"));  //$NON-NLS-1$
 		}
 		replace = newReplacement;
 		implReplaceWith(newReplacement);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CharsetEncoder.java
Wed Sep  6 01:33:37 2006
@@ -250,8 +250,9 @@
 			status = INIT;
 		}
 		if (status != INIT) {
+            // niochar.0B=Another encoding process is ongoing\!
 			throw new IllegalStateException(
-					"Another encoding process is ongoing!"); //$NON-NLS-1$
+					Messages.getString("niochar.0B"));  //$NON-NLS-1$
 		}
 		CodingErrorAction malformBak = malformAction;
 		CodingErrorAction unmapBak = unmapAction;
@@ -780,8 +781,9 @@
 	 */
 	public final CharsetEncoder onMalformedInput(CodingErrorAction newAction) {
 		if (null == newAction) {
+            // niochar.0C=Action on malformed input error cannot be null\!
 			throw new IllegalArgumentException(
-					"Action on malformed input error cannot be null!"); //$NON-NLS-1$
+					Messages.getString("niochar.0C"));  //$NON-NLS-1$
 		}
 		malformAction = newAction;
 		implOnMalformedInput(newAction);
@@ -804,8 +806,9 @@
 	public final CharsetEncoder onUnmappableCharacter(
 			CodingErrorAction newAction) {
 		if (null == newAction) {
+            // niochar.0D=Action on unmappable character error cannot be null\!
 			throw new IllegalArgumentException(
-					"Action on unmappable character error cannot be null!"); //$NON-NLS-1$
+					Messages.getString("niochar.0D"));  //$NON-NLS-1$
 		}
 		unmapAction = newAction;
 		implOnUnmappableCharacter(newAction);
@@ -845,7 +848,8 @@
 		if (null == replacement || 0 == replacement.length
 				|| maxBytes < replacement.length
 				|| !isLegalReplacement(replacement)) {
-			throw new IllegalArgumentException("Replacement is illegal"); //$NON-NLS-1$
+            // niochar.0E=Replacement is illegal
+			throw new IllegalArgumentException(Messages.getString("niochar.0E"));  //$NON-NLS-1$
 		}
 		replace = replacement;
 		implReplaceWith(replacement);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java
Wed Sep  6 01:33:37 2006
@@ -20,6 +20,8 @@
 import java.nio.BufferUnderflowException;
 import java.util.WeakHashMap;
 
+import org.apache.harmony.niochar.internal.nls.Messages;
+
 /**
  * Used to indicate the result of encoding/decoding. There are four types of
  * results:
@@ -149,7 +151,8 @@
 				return r;
 			}
 		}
-		throw new IllegalArgumentException("The length must be positive."); //$NON-NLS-1$
+        // niochar.08=The length must be positive.
+		throw new IllegalArgumentException(Messages.getString("niochar.08"));  //$NON-NLS-1$
 	}
 
 	/**
@@ -177,7 +180,8 @@
 				return r;
 			}
 		}
-		throw new IllegalArgumentException("The length must be positive."); //$NON-NLS-1$
+        // niochar.08=The length must be positive.
+		throw new IllegalArgumentException(Messages.getString("niochar.08"));  //$NON-NLS-1$
 	}
 
 	/**
@@ -241,8 +245,10 @@
 				|| this.type == TYPE_UNMAPPABLE_CHAR) {
 			return this.length;
 		}
-		throw new UnsupportedOperationException(
-				"The length of the erroneous input is only meaningful to a malformed-input error or an
unmappble character error"); //$NON-NLS-1$
+		// niochar.09=The length of the erroneous input is only meaningful to 
+        // a malformed-input error or an unmappble character error
+        throw new UnsupportedOperationException(
+				Messages.getString("niochar.09"));  //$NON-NLS-1$
 	}
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java
Wed Sep  6 01:33:37 2006
@@ -15,6 +15,8 @@
 
 package java.nio.charset;
 
+import org.apache.harmony.niochar.internal.nls.Messages;
+
 
 /**
  * Thrown when an illegal charset name is encountered.
@@ -56,7 +58,8 @@
 	 *            the encountered illegal charset name
 	 */
 	public IllegalCharsetNameException(String charset) {
-		super("The illegal charset name is \"" + charset + "\"."); //$NON-NLS-1$ //$NON-NLS-2$
+        // niochar.0F=The illegal charset name is "{0}".
+		super(Messages.getString("niochar.0F", charset));  //$NON-NLS-1$
 		this.charsetName = charset;
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java
Wed Sep  6 01:33:37 2006
@@ -15,6 +15,8 @@
 
 package java.nio.charset;
 
+import org.apache.harmony.niochar.internal.nls.Messages;
+
 
 /**
  * Thrown when a malformed input is encountered, for example, a byte sequence is
@@ -87,7 +89,8 @@
 	 * @return a message describing this exception
 	 */
 	public String getMessage() {
-		return "Malformed input length is " + this.inputLength + "."; //$NON-NLS-1$ //$NON-NLS-2$
+        // niochar.05=Malformed input length is {0}.
+		return Messages.getString("niochar.05", this.inputLength);  //$NON-NLS-1$
 	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java
Wed Sep  6 01:33:37 2006
@@ -15,6 +15,8 @@
 
 package java.nio.charset;
 
+import org.apache.harmony.niochar.internal.nls.Messages;
+
 
 /**
  * Thrown when an unmappable character for the given charset is encountered.
@@ -87,7 +89,8 @@
 	 * @return a message describing this exception
 	 */
 	public String getMessage() {
-		return "The unmappable character length is " + this.inputLength + "."; //$NON-NLS-1$ //$NON-NLS-2$
+        // niochar.0A=The unmappable character length is {0}.
+		return Messages.getString("niochar.0A", this.inputLength);  //$NON-NLS-1$
 	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java
Wed Sep  6 01:33:37 2006
@@ -15,6 +15,8 @@
 
 package java.nio.charset;
 
+import org.apache.harmony.niochar.internal.nls.Messages;
+
 
 /**
  * Thrown when an unsupported charset name is encountered.
@@ -56,7 +58,8 @@
 	 *            the encountered unsupported charset name
 	 */
 	public UnsupportedCharsetException(String charset) {
-		super("The unsupported charset name is \"" + charset + "\"."); //$NON-NLS-1$ //$NON-NLS-2$
+        // niochar.04=The unsupported charset name is "{0}".
+		super(Messages.getString("niochar.04", charset));  //$NON-NLS-1$
 		this.charsetName = charset;
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/org/apache/harmony/niochar/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/org/apache/harmony/niochar/internal/nls/messages.properties?view=diff&rev=440655&r1=440654&r2=440655
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/org/apache/harmony/niochar/internal/nls/messages.properties
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/org/apache/harmony/niochar/internal/nls/messages.properties
Wed Sep  6 01:33:37 2006
@@ -18,3 +18,15 @@
 niochar.01=averageCharsPerByte is greater than maxCharsPerByte
 niochar.02=Bytes number for one character must be positive.
 niochar.03=averageBytesPerChar is greater than maxBytesPerChar.
+niochar.04=The unsupported charset name is "{0}".
+niochar.05=Malformed input length is {0}.
+niochar.06=Replacement string cannot be null or empty.
+niochar.07=Replacement string's length cannot be larger than max characters per byte.
+niochar.08=The length must be positive.
+niochar.09=The length of the erroneous input is only meaningful to a malformed-input error
or an unmappble character error
+niochar.0A=The unmappable character length is {0}.
+niochar.0B=Another encoding process is ongoing\!
+niochar.0C=Action on malformed input error cannot be null\!
+niochar.0D=Action on unmappable character error cannot be null\!
+niochar.0E=Replacement is illegal
+niochar.0F=The illegal charset name is "{0}".



Mime
View raw message