You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2010/02/12 19:59:24 UTC

svn commit: r909560 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java: java/lang/ java/lang/reflect/ org/apache/harmony/luni/internal/nls/

Author: hindessm
Date: Fri Feb 12 18:59:23 2010
New Revision: 909560

URL: http://svn.apache.org/viewvc?rev=909560&view=rev
Log:
More nls refactoring and in the process fixing bug because
EnumConstantNotPresentException was using a new 'luni.03'
token but with the old message catalog.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/EnumConstantNotPresentException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/Proxy.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java Fri Feb 12 18:59:23 2010
@@ -20,7 +20,7 @@
 import java.io.InvalidObjectException;
 import java.util.Arrays;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * A modifiable {@link CharSequence sequence of characters} for use in creating
@@ -64,7 +64,7 @@
             val = new char[0];
         }
         if (val.length < len) {
-            throw new InvalidObjectException(Msg.getString("K0199")); //$NON-NLS-1$
+            throw new InvalidObjectException(Messages.getString("luni.4A")); //$NON-NLS-1$
         }
 
         shared = false;
@@ -121,12 +121,12 @@
     final void append0(char[] chars, int offset, int length) {
         // Force null check of chars first!
         if (offset > chars.length || offset < 0) {
-            // K002e=Offset out of bounds \: {0}
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset)); //$NON-NLS-1$
+            // luni.12=Offset out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.12", offset)); //$NON-NLS-1$
         }
         if (length < 0 || chars.length - offset < length) {
-            // K0031=Length out of bounds \: {0}
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K0031", length)); //$NON-NLS-1$
+            // luni.18=Length out of bounds \: {0}
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.18", length)); //$NON-NLS-1$
         }
 
         int newSize = count + length;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java Fri Feb 12 18:59:23 2010
@@ -17,7 +17,7 @@
 
 package java.lang;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * Thrown when the an array is indexed with a value less than zero, or greater
@@ -44,8 +44,8 @@
      *            the invalid index.
      */
     public ArrayIndexOutOfBoundsException(int index) {
-        // K0052=Array index out of range\: {0}
-        super(Msg.getString("K0052", index)); //$NON-NLS-1$
+        // luni.36=Array index out of range\: {0}
+        super(Messages.getString("luni.36", index)); //$NON-NLS-1$
     }
 
     /**

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java Fri Feb 12 18:59:23 2010
@@ -17,7 +17,7 @@
 
 package java.lang;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * Thrown when a program attempts to cast a an object to a type with which it is
@@ -55,7 +55,7 @@
      *            the class being cast to.
      */
     ClassCastException(Class<?> instanceClass, Class<?> castClass) {
-        super(Msg.getString("K0340", instanceClass.getName(), castClass //$NON-NLS-1$
+        super(Messages.getString("luni.4B", instanceClass.getName(), castClass //$NON-NLS-1$
                 .getName()));
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java Fri Feb 12 18:59:23 2010
@@ -21,7 +21,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * The superclass of all enumerated types. Actual enumeration types inherit from
@@ -113,8 +113,8 @@
      */
     @Override
     protected final Object clone() throws CloneNotSupportedException {
-        // KA004=Enums may not be cloned
-        throw new CloneNotSupportedException(Msg.getString("KA004")); //$NON-NLS-1$
+        // luni.4C=Enums may not be cloned
+        throw new CloneNotSupportedException(Messages.getString("luni.4C")); //$NON-NLS-1$
     }
 
     /**
@@ -167,21 +167,21 @@
      */
     public static <T extends Enum<T>> T valueOf(Class<T> enumType, String name) {
         if ((enumType == null) || (name == null)) {
-            // KA001=Argument must not be null
-            throw new NullPointerException(Msg.getString("KA001")); //$NON-NLS-1$
+            // luni.4D=Argument must not be null
+            throw new NullPointerException(Messages.getString("luni.4D")); //$NON-NLS-1$
         }
         T[] values = getValues(enumType);
         if (values == null) {
-            // KA005={0} is not an enum type
-            throw new IllegalArgumentException(Msg.getString("KA005", enumType)); //$NON-NLS-1$
+            // luni.4E={0} is not an enum type
+            throw new IllegalArgumentException(Messages.getString("luni.4E", enumType)); //$NON-NLS-1$
         }
         for (T enumConst : values) {
             if (enumConst.name.equals(name)) {
                 return enumConst;
             }
         }
-        // KA006={0} is not a constant in the enum type {1}
-        throw new IllegalArgumentException(Msg.getString("KA006", name, //$NON-NLS-1$
+        // luni.4F={0} is not a constant in the enum type {1}
+        throw new IllegalArgumentException(Messages.getString("luni.4F", name, //$NON-NLS-1$
                 enumType));
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/EnumConstantNotPresentException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/EnumConstantNotPresentException.java?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/EnumConstantNotPresentException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/EnumConstantNotPresentException.java Fri Feb 12 18:59:23 2010
@@ -16,7 +16,7 @@
 
 package java.lang;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * Thrown if an {@code enum} constant does not exist for a particular name.
@@ -46,7 +46,7 @@
     public EnumConstantNotPresentException(Class<? extends Enum> enumType,
             String constantName) {
         // luni.03=The enum constant {0}.{1} is missing
-        super(Msg.getString("luni.03", enumType.getName(), constantName)); //$NON-NLS-1$
+        super(Messages.getString("luni.03", enumType.getName(), constantName)); //$NON-NLS-1$
         this.enumType = enumType;
         this.constantName = constantName;
     }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java Fri Feb 12 18:59:23 2010
@@ -18,7 +18,7 @@
 package java.lang;
 
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * Thrown when the a string is indexed with a value less than zero, or greater
@@ -45,7 +45,7 @@
      *            the index which is out of bounds.
      */    
     public StringIndexOutOfBoundsException(int index) {
-        super(Msg.getString("K0055", index)); //$NON-NLS-1$
+        super(Messages.getString("luni.55", index)); //$NON-NLS-1$
     }
 
     /**

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/Proxy.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/Proxy.java?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/Proxy.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/Proxy.java Fri Feb 12 18:59:23 2010
@@ -25,7 +25,7 @@
 
 import org.apache.harmony.luni.internal.reflect.ProxyClassFile;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * {@code Proxy} defines methods for creating dynamic proxy classes and instances.
@@ -102,22 +102,22 @@
             }
             String name = next.getName();
             if (!next.isInterface()) {
-                throw new IllegalArgumentException(Msg.getString("K00ed", name)); //$NON-NLS-1$
+                throw new IllegalArgumentException(Messages.getString("luni.50", name)); //$NON-NLS-1$
             }
             if (loader != next.getClassLoader()) {
                 try {
                     if (next != Class.forName(name, false, loader)) {
-                        throw new IllegalArgumentException(Msg.getString(
-                                "K00ee", name)); //$NON-NLS-1$
+                        throw new IllegalArgumentException(Messages.getString(
+                                "luni.51", name)); //$NON-NLS-1$
                     }
                 } catch (ClassNotFoundException ex) {
-                    throw new IllegalArgumentException(Msg.getString("K00ee", //$NON-NLS-1$
+                    throw new IllegalArgumentException(Messages.getString("luni.51", //$NON-NLS-1$
                             name));
                 }
             }
             for (int j = i + 1; j < length; j++) {
                 if (next == interfaces[j]) {
-                    throw new IllegalArgumentException(Msg.getString("K00ef", //$NON-NLS-1$
+                    throw new IllegalArgumentException(Messages.getString("luni.52", //$NON-NLS-1$
                             name));
                 }
             }
@@ -127,7 +127,7 @@
                 if (commonPackageName == null) {
                     commonPackageName = p;
                 } else if (!commonPackageName.equals(p)) {
-                    throw new IllegalArgumentException(Msg.getString("K00f0")); //$NON-NLS-1$
+                    throw new IllegalArgumentException(Messages.getString("luni.53")); //$NON-NLS-1$
                 }
             }
         }
@@ -269,7 +269,7 @@
             return ((Proxy) proxy).h;
         }
 
-        throw new IllegalArgumentException(Msg.getString("K00f1")); //$NON-NLS-1$
+        throw new IllegalArgumentException(Messages.getString("luni.54")); //$NON-NLS-1$
     }
 
     private static native Class<?> defineClassImpl(ClassLoader classLoader,

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties?rev=909560&r1=909559&r2=909560&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties Fri Feb 12 18:59:23 2010
@@ -88,3 +88,15 @@
 luni.47=Invalid UUID string
 luni.48=day of week\: {0}
 luni.49=SocketAddress {0} not supported
+luni.4A=Count out of range
+luni.4B={0} incompatible with {1}
+luni.4C=Enums may not be cloned
+luni.4D=Argument must not be null
+luni.4E={0} is not an enum type
+luni.4F={0} is not a constant in the enum type {1}
+luni.50={0} is not an interface
+luni.51={0} is not visible from class loader
+luni.52={0} appears more than once
+luni.53=non-public interfaces must be in the same package
+luni.54=not a proxy instance
+luni.55=String index out of range\: {0}