harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r926832 - in /harmony/enhanced/trunk/classlib/modules/beans/src/main/java: java/beans/ java/beans/beancontext/ org/apache/harmony/beans/internal/nls/
Date Tue, 23 Mar 2010 22:50:27 GMT
Author: hindessm
Date: Tue Mar 23 22:50:27 2010
New Revision: 926832

URL: http://svn.apache.org/viewvc?rev=926832&view=rev
Log:
NLS fixes.

Modified:
    harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLDecoder.java
    harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLEncoder.java
    harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
    harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
    harmony/enhanced/trunk/classlib/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties

Modified: harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLDecoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLDecoder.java?rev=926832&r1=926831&r2=926832&view=diff
==============================================================================
--- harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLDecoder.java
(original)
+++ harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLDecoder.java
Tue Mar 23 22:50:27 2010
@@ -84,7 +84,7 @@ public class XMLDecoder {
                     inJavaElem = true;
                 } else {
                     listener.exceptionThrown(new Exception(
-                            "unknown root element: " + qName));
+                            Messages.getString("beans.72", qName)));
                 }
                 return;
             }
@@ -477,7 +477,7 @@ public class XMLDecoder {
             } else if ("short".equals(tag)) {
                 return Short.valueOf(value);
             } else {
-                throw new Exception("Unknown tag of basic type: " + tag);
+                throw new Exception(Messages.getString("beans.71", tag));
             }
         }
 
@@ -639,12 +639,12 @@ public class XMLDecoder {
         }
 
         if (readObjIndex >= readObjs.size()) {
-            throw new ArrayIndexOutOfBoundsException("no more objects to read");
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("beans.70"));
         }
         Elem elem = readObjs.get(readObjIndex);
         if (!elem.isClosed) {
             // bad element, error occurred while parsing
-            throw new ArrayIndexOutOfBoundsException("no more objects to read");
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("beans.70"));
         }
         readObjIndex++;
         return elem.result;

Modified: harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLEncoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLEncoder.java?rev=926832&r1=926831&r2=926832&view=diff
==============================================================================
--- harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLEncoder.java
(original)
+++ harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/XMLEncoder.java
Tue Mar 23 22:50:27 2010
@@ -31,6 +31,8 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.harmony.awt.internal.nls.Messages;
+
 /**
  * <code>XMLEncoder</code> extends <code>Encoder</code> to write
out the
  * encoded statements and expressions in xml format. The xml can be read by
@@ -234,7 +236,7 @@ public class XMLEncoder extends Encoder 
 			out.println("</short>");
 		} else {
 			getExceptionListener().exceptionThrown(
-					new Exception("Unknown basic object: " + obj));
+                                       new Exception(Messages.getString("beans.73", obj)));
 		}
 	}
 

Modified: harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java?rev=926832&r1=926831&r2=926832&view=diff
==============================================================================
--- harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
(original)
+++ harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
Tue Mar 23 22:50:27 2010
@@ -692,7 +692,7 @@ public class BeanContextServicesSupport 
             }
             if (bcssChild == null) {
                 throw new IllegalArgumentException(
-                        "not a child of this context");
+                        Messages.getString("beans.65"));
             }
 
             // try local service
@@ -828,7 +828,7 @@ public class BeanContextServicesSupport 
             }
             if (bcssChild == null) {
                 throw new IllegalArgumentException(
-                        "not a child of this context");
+                        Messages.getString("beans.65"));
             }
 
             releaseServiceWithoutCheck(child, bcssChild, requestor, service,
@@ -920,7 +920,7 @@ public class BeanContextServicesSupport 
                 }
                 if (bcssProvider.getServiceProvider() != serviceProvider) {
                     throw new IllegalArgumentException(
-                            "not the service provider registered with this context");
+                            Messages.getString("beans.66"));
                 }
 
                 services.remove(serviceClass);

Modified: harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java?rev=926832&r1=926831&r2=926832&view=diff
==============================================================================
--- harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
(original)
+++ harmony/enhanced/trunk/classlib/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
Tue Mar 23 22:50:27 2010
@@ -219,7 +219,7 @@ public class BeanContextSupport extends 
     @SuppressWarnings("unchecked")
     public boolean add(Object child) {
         if (child == null) {
-            throw new IllegalArgumentException("null child");
+            throw new IllegalArgumentException(Messages.getString("beans.67"));
         }
 
         BeanContextChild proxy = null;
@@ -233,14 +233,14 @@ public class BeanContextSupport extends 
             // check serializing state
             if (serializing) {
                 throw new IllegalStateException(
-                        "cannot update children during serialization");
+                        Messages.getString("beans.68"));
             }
 
             // validate
             boolean valid = validatePendingAdd(child);
             if (!valid) {
                 throw new IllegalStateException(
-                        "Validation failed to add the child");
+                        Messages.getString("beans.69"));
             }
 
             // find the proxy, if there's one
@@ -248,7 +248,7 @@ public class BeanContextSupport extends 
                 proxy = ((BeanContextProxy) child).getBeanContextProxy();
                 if (proxy == null) {
                     throw new NullPointerException(
-                            "null BeanContextChild proxy");
+                            Messages.getString("beans.6A"));
                 }
             }
             BeanContextChild beanContextChild = getChildBeanContextChild(child);
@@ -276,7 +276,7 @@ public class BeanContextSupport extends 
                         }
                     }
                     throw new IllegalStateException(
-                            "failed to update child's beanContext property");
+                            Messages.getString("beans.6B"));
                 }
                 // ensure no duplicate listener
                 beanContextChild.removePropertyChangeListener("beanContext",
@@ -592,14 +592,14 @@ public class BeanContextSupport extends 
         if (child instanceof BeanContextChild) {
             if (child instanceof BeanContextProxy) {
                 throw new IllegalArgumentException(
-                        "Illegal to impl both BeanContextChild and BeanContextProxy");
+                        Messages.getString("beans.6C"));
             }
             return (BeanContextChild) child;
         }
         if (child instanceof BeanContextProxy) {
             if (child instanceof BeanContextChild) {
                 throw new IllegalArgumentException(
-                        "Illegal to impl both BeanContextChild and BeanContextProxy");
+                        Messages.getString("beans.6C"));
             }
             return ((BeanContextProxy) child).getBeanContextProxy();
         }
@@ -706,7 +706,7 @@ public class BeanContextSupport extends 
             throw new NullPointerException();
         }
         if (!contains(child)) {
-            throw new IllegalArgumentException("Not a child of this context");
+            throw new IllegalArgumentException(Messages.getString("beans.6D"));
         }
 
         return ClassLoader.getSystemResource(resourceName);
@@ -721,7 +721,7 @@ public class BeanContextSupport extends 
             throw new NullPointerException();
         }
         if (!contains(child)) {
-            throw new IllegalArgumentException("Not a child of this context");
+            throw new IllegalArgumentException(Messages.getString("beans.6D"));
         }
 
         return ClassLoader.getSystemResourceAsStream(resourceName);
@@ -890,7 +890,7 @@ public class BeanContextSupport extends 
                         beanContextChild.setBeanContext(getBeanContextPeer());
                     } catch (PropertyVetoException e) {
                         throw new IOException(
-                                "failed to update child's beanContext property");
+                                Messages.getString("beans.6B"));
                     }
                     // ensure no duplicate listener
                     beanContextChild.removePropertyChangeListener(
@@ -936,7 +936,7 @@ public class BeanContextSupport extends 
      */
     protected boolean remove(Object child, boolean setChildBC) {
         if (child == null) {
-            throw new IllegalArgumentException("null child");
+            throw new IllegalArgumentException(Messages.getString("beans.67"));
         }
 
         Object peer = null;
@@ -950,14 +950,14 @@ public class BeanContextSupport extends 
             // check serializing state
             if (serializing) {
                 throw new IllegalStateException(
-                        "cannot update children during serialization");
+                        Messages.getString("beans.68"));
             }
 
             // validate
             boolean valid = validatePendingRemove(child);
             if (!valid) {
                 throw new IllegalStateException(
-                        "Validation failed to remove the child");
+                        Messages.getString("beans.6E"));
             }
 
             // set child's beanContext property
@@ -973,7 +973,7 @@ public class BeanContextSupport extends 
                     beanContextChild.addPropertyChangeListener("beanContext",
                             nonSerPCL);
                     throw new IllegalStateException(
-                            "failed to update child's beanContext property");
+                            Messages.getString("beans.6B"));
                 }
             }
 
@@ -1215,7 +1215,7 @@ public class BeanContextSupport extends 
 
             // what if count not equals to serializable?
             if (count != serializable) {
-                throw new IOException("children changed during serialization!");
+                throw new IOException(Messages.getString("beans.6F"));
             }
         } finally {
             serializing = origSer;

Modified: harmony/enhanced/trunk/classlib/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/trunk/classlib/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties?rev=926832&r1=926831&r2=926832&view=diff
==============================================================================
--- harmony/enhanced/trunk/classlib/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties
(original)
+++ harmony/enhanced/trunk/classlib/modules/beans/src/main/java/org/apache/harmony/beans/internal/nls/messages.properties
Tue Mar 23 22:50:27 2010
@@ -116,3 +116,18 @@ beans.61=Indexed write method is not com
 beans.62=Cannot decide which method to call to match {0}
 beans.63=The type of element is mismatch with the type of array
 beans.64=Method not found: {0}
+beans.65=not a child of this context
+beans.66=not the service provider registered with this context
+beans.67=null child
+beans.68=cannot update children during serialization
+beans.69=Validation failed to add the child
+beans.6A=null BeanContextChild proxy
+beans.6B=failed to update child's beanContext property
+beans.6C=Illegal to impl both BeanContextChild and BeanContextProxy
+beans.6D=Not a child of this context
+beans.6E=Validation failed to remove the child
+beans.6F=children changed during serialization!
+beans.70=no more objects to read
+beans.71=Unknown tag of basic type: {0}
+beans.72=Unknown root element: {0}
+beans.73=Unknown basic object: {0}



Mime
View raw message