harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r440601 - 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 03:48:28 GMT
Author: pyang
Date: Tue Sep  5 20:48:27 2006
New Revision: 440601

URL: http://svn.apache.org/viewvc?view=rev&rev=440601
Log:
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/Charset.java
    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/org/apache/harmony/niochar/internal/nls/messages.properties

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java?view=diff&rev=440601&r1=440600&r2=440601
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
Tue Sep  5 20:48:27 2006
@@ -640,8 +640,8 @@
 	 *         false.
 	 */
 	public final boolean isRegistered() {
-		return !canonicalName.startsWith("x-")
-				&& !canonicalName.startsWith("X-");
+		return !canonicalName.startsWith("x-") //$NON-NLS-1$
+				&& !canonicalName.startsWith("X-"); //$NON-NLS-1$
 	}
 
 	/**

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=440601&r1=440600&r2=440601
==============================================================================
--- 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
Tue Sep  5 20:48:27 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 
+import org.apache.harmony.niochar.internal.nls.Messages;
+
 /**
  * An converter that can convert bytes sequence in some charset to 16-bit
  * Unicode character sequence.
@@ -159,12 +161,14 @@
 	protected CharsetDecoder(Charset charset, float averageCharsPerByte,
 			float maxCharsPerByte) {
 		if (averageCharsPerByte <= 0 || maxCharsPerByte <= 0) {
+            // niochar.00=Characters number for one byte must be positive.
 			throw new IllegalArgumentException(
-					"Characters number for one byte must be positive.");
+					Messages.getString("niochar.00")); //$NON-NLS-1$
 		}
 		if(averageCharsPerByte > maxCharsPerByte){
+            // niochar.01=averageCharsPerByte is greater than maxCharsPerByte
 			throw new IllegalArgumentException(
-					"averageCharsPerByte is greater than maxCharsPerByte");
+					Messages.getString("niochar.01")); //$NON-NLS-1$
 		}
 		averChars = averageCharsPerByte;
 		maxChars = maxCharsPerByte;

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=440601&r1=440600&r2=440601
==============================================================================
--- 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
Tue Sep  5 20:48:27 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 
+import org.apache.harmony.niochar.internal.nls.Messages;
+
 /**
  * An converter that can convert 16-bit Unicode character sequence to byte
  * sequence in some charset .
@@ -189,12 +191,14 @@
 	protected CharsetEncoder(Charset cs, float averageBytesPerChar,
 			float maxBytesPerChar, byte[] replacement) {
 		if (averageBytesPerChar <= 0 || maxBytesPerChar <= 0) {
+            // niochar.02=Bytes number for one character must be positive.
 			throw new IllegalArgumentException(
-					"Bytes number for one character must be positive.");
+					Messages.getString("niochar.02")); //$NON-NLS-1$
 		}
 		if (averageBytesPerChar > maxBytesPerChar) {
+            // niochar.03=averageBytesPerChar is greater than maxBytesPerChar.
 			throw new IllegalArgumentException(
-					"averageBytesPerChar is greater than maxBytesPerChar.");
+					Messages.getString("niochar.03")); //$NON-NLS-1$
 		}
 		this.cs = cs;
 		averBytes = averageBytesPerChar;

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=440601&r1=440600&r2=440601
==============================================================================
--- 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
Tue Sep  5 20:48:27 2006
@@ -13,4 +13,8 @@
 #  limitations under the License.
 # 
 
-# messages for EN locale
\ No newline at end of file
+# messages for EN locale
+niochar.00=Characters number for one byte must be positive.
+niochar.01=averageCharsPerByte is greater than maxCharsPerByte
+niochar.02=Bytes number for one character must be positive.
+niochar.03=averageBytesPerChar is greater than maxBytesPerChar.



Mime
View raw message