harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r453541 [4/6] - in /incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java: java/rmi/ java/rmi/activation/ java/rmi/dgc/ java/rmi/registry/ java/rmi/server/ org/apache/harmony/rmi/ org/apache/harmony/rmi/activation/ org/apache/...
Date Fri, 06 Oct 2006 10:15:55 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java Fri Oct  6 03:15:51 2006
@@ -36,6 +36,7 @@
 import org.apache.harmony.rmi.common.RMIHash;
 import org.apache.harmony.rmi.common.RMIHashException;
 import org.apache.harmony.rmi.common.RMIUtil;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -137,7 +138,8 @@
     ClassStub(int version, Class cls) throws RMICompilerException {
         // Check version.
         if ((version < MIN_VERSION) || (version > MAX_VERSION)) {
-            throw new RMICompilerException("Incorrect version specified.");
+            // rmi.50=Incorrect version specified.
+            throw new RMICompilerException(Messages.getString("rmi.50")); //$NON-NLS-1$
         }
 
         // Set appropriate version flags.
@@ -158,29 +160,28 @@
             vCompat = true;
             break;
         default:
-            throw new RMICompilerException("Version currently unsupported.");
+            // rmi.51=Version currently unsupported.
+            throw new RMICompilerException(Messages.getString("rmi.51")); //$NON-NLS-1$
         }
 
         className = RMIUtil.getCanonicalName(cls);
 
         // Check if the specified class is interface.
         if (cls.isInterface()) {
-            throw new RMICompilerException("Class " + className
-                    + " is interface, and so does not need an RMI stub.");
+            // rmi.52=Class {0} is interface, and so does not need an RMI stub.
+            throw new RMICompilerException(Messages.getString("rmi.52", className)); //$NON-NLS-1$
         }
 
         // Check if the specified class is remote.
         if (!Remote.class.isAssignableFrom(cls)) {
-            throw new RMICompilerException("Class " + className
-                    + " does not implement a remote interface,"
-                    + " and so does not need an RMI stub.");
+            // rmi.53=Class {0} does not implement a remote interface, and so does not need an RMI stub.
+            throw new RMICompilerException(Messages.getString("rmi.53", className)); //$NON-NLS-1$
         }
 
         // Check if the specified class implements any remote interfaces.
         if (!new ClassList(cls.getInterfaces()).contains(Remote.class)) {
-            throw new RMICompilerException("Class " + className
-                    + " does not directly implement a remote interface,"
-                    + " and so does not need an RMI stub.");
+            // rmi.54=Class {0} does not directly implement a remote interface, and so does not need an RMI stub.
+            throw new RMICompilerException(Messages.getString("rmi.54", className)); //$NON-NLS-1$
         }
 
         // Initialize class variables.
@@ -243,7 +244,8 @@
         try {
             return Class.forName(className);
         } catch (ClassNotFoundException e) {
-            throw new RMICompilerException("Class not found: " + className);
+            // rmi.55=Class not found: {0}
+            throw new RMICompilerException(Messages.getString("rmi.55", className)); //$NON-NLS-1$
         }
     }
 
@@ -273,17 +275,17 @@
     String getStubSource() {
         indenter = new Indenter();
 
-        return (getStubHeader("stub") + getPackageStatement() + EOLN
+        return (getStubHeader("stub") + getPackageStatement() + EOLN //$NON-NLS-1$
                 + getStubClassDeclaration() + indenter.hIncrease()
-                + (v12 ? (EOLN + getSerialVersionUID()) : "")
+                + (v12 ? (EOLN + getSerialVersionUID()) : "") //$NON-NLS-1$
                 + (v11 ? (EOLN + getInterfaceHash() + (methodsExist
-                        ? ((vCompat ? EOLN + getNewInvoke() : "")
-                        + EOLN + getOperationsArrayDeclaration()) : "")) : "")
+                        ? ((vCompat ? EOLN + getNewInvoke() : "") //$NON-NLS-1$
+                        + EOLN + getOperationsArrayDeclaration()) : "")) : "") //$NON-NLS-1$ //$NON-NLS-2$
                 + ((v12 && methodsExist) ? (EOLN
                         + getMethodVariablesDeclaration() + EOLN
-                        + getStaticInitializationBlock()) : "") + EOLN
+                        + getStaticInitializationBlock()) : "") + EOLN //$NON-NLS-1$
                 + getStubConstructors()
-                + (methodsExist ? getMethodImplementations() : "")
+                + (methodsExist ? getMethodImplementations() : "") //$NON-NLS-1$
                 + indenter.decrease() + '}' + EOLN + indenter.assertEmpty());
     }
 
@@ -295,7 +297,7 @@
     String getSkeletonSource() {
         indenter = new Indenter();
 
-        return (getStubHeader("skeleton") + getPackageStatement() + EOLN
+        return (getStubHeader("skeleton") + getPackageStatement() + EOLN //$NON-NLS-1$
                 + getSkeletonClassDeclaration()
                 + indenter.hIncrease() + EOLN + getInterfaceHash() + EOLN
                 + getOperationsArrayDeclaration() + EOLN
@@ -313,15 +315,15 @@
      * @return  Stub/skeleton header.
      */
     private String getStubHeader(String type) {
-        return ("/*" + EOLN + " * RMI " + type + " class" + EOLN
-                + " * for class " + className + EOLN
-                + " * Compatible with stub protocol version "
-                + (v11 ? "1.1" : "") + (vCompat ? "/" : "")
-                + (v12 ? "1.2" : "") + EOLN + " *" + EOLN
-                + " * Generated by DRL RMI Compiler (rmic)." + EOLN
-                + " *" + EOLN + " * DO NOT EDIT!!!" + EOLN
-                + " * Contents subject to change without notice!" + EOLN
-                + " */" + EOLN);
+        return ("/*" + EOLN + " * RMI " + type + " class" + EOLN //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                + " * for class " + className + EOLN //$NON-NLS-1$
+                + " * Compatible with stub protocol version " //$NON-NLS-1$
+                + (v11 ? "1.1" : "") + (vCompat ? "/" : "") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+                + (v12 ? "1.2" : "") + EOLN + " *" + EOLN //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                + " * Generated by DRL RMI Compiler (rmic)." + EOLN //$NON-NLS-1$
+                + " *" + EOLN + " * DO NOT EDIT!!!" + EOLN //$NON-NLS-1$ //$NON-NLS-2$
+                + " * Contents subject to change without notice!" + EOLN //$NON-NLS-1$
+                + " */" + EOLN); //$NON-NLS-1$
     }
 
     /**
@@ -331,8 +333,8 @@
      * @return  <code>package</code> statement for stub/skeleton class.
      */
     private String getPackageStatement() {
-        return ((packageName == null) ? ""
-                : ("package " + packageName + ';' + EOLN + EOLN));
+        return ((packageName == null) ? "" //$NON-NLS-1$
+                : ("package " + packageName + ';' + EOLN + EOLN)); //$NON-NLS-1$
     }
 
     /**
@@ -342,16 +344,16 @@
      * @return  Stub class declaration statement.
      */
     private String getStubClassDeclaration() {
-        StringBuffer buffer = new StringBuffer("public final class "
-                + stubName + " extends java.rmi.server.RemoteStub" + EOLN
-                + indenter.tIncrease(2) + "implements ");
+        StringBuffer buffer = new StringBuffer("public final class " //$NON-NLS-1$
+                + stubName + " extends java.rmi.server.RemoteStub" + EOLN //$NON-NLS-1$
+                + indenter.tIncrease(2) + "implements "); //$NON-NLS-1$
 
         // Add implemented interfaces list.
         for (int i = 0; i < interfaces.length; i++) {
-            buffer.append(((i > 0) ? ", " : "" ) + interfaces[i].getName());
+            buffer.append(((i > 0) ? ", " : "" ) + interfaces[i].getName()); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
-        buffer.append(" {" + EOLN);
+        buffer.append(" {" + EOLN); //$NON-NLS-1$
 
         return buffer.toString();
     }
@@ -363,8 +365,8 @@
      * @return  Skeleton class declaration statement.
      */
     private String getSkeletonClassDeclaration() {
-        return ("public final class " + skelName
-                + " implements java.rmi.server.Skeleton {" + EOLN);
+        return ("public final class " + skelName //$NON-NLS-1$
+                + " implements java.rmi.server.Skeleton {" + EOLN); //$NON-NLS-1$
     }
 
     /**
@@ -375,7 +377,7 @@
      */
     private String getSerialVersionUID() {
         return (indenter.indent()
-                    + "private static final long serialVersionUID = 2;" + EOLN);
+                    + "private static final long serialVersionUID = 2;" + EOLN); //$NON-NLS-1$
     }
 
     /**
@@ -385,8 +387,8 @@
      * @return  <code>interfaceHash</code> declaration statement.
      */
     private String getInterfaceHash() {
-        return (indenter.indent() + "private static final long "
-                + interfaceHashVarName + " = " + interfaceHash + "L;" + EOLN);
+        return (indenter.indent() + "private static final long " //$NON-NLS-1$
+                + interfaceHashVarName + " = " + interfaceHash + "L;" + EOLN); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
     /**
@@ -397,7 +399,7 @@
      */
     private String getNewInvoke() {
         return (indenter.indent()
-                + "private static boolean " + useNewInvoke + ';'+ EOLN);
+                + "private static boolean " + useNewInvoke + ';'+ EOLN); //$NON-NLS-1$
     }
 
     /**
@@ -408,21 +410,21 @@
      */
     private String getOperationsArrayDeclaration() {
         StringBuffer buffer = new StringBuffer(indenter.indent()
-                + "private static final java.rmi.server.Operation[]"
-                + " operations = {");
+                + "private static final java.rmi.server.Operation[]" //$NON-NLS-1$
+                + " operations = {"); //$NON-NLS-1$
 
         if (methodsExist) {
             buffer.append(EOLN + indenter.hIncrease());
 
             for (Iterator i = methods.iterator(); i.hasNext(); ) {
                 buffer.append(((MethodStub) i.next()).getOpsArrayElement()
-                        + (i.hasNext() ? "," : "" ) + EOLN);
+                        + (i.hasNext() ? "," : "" ) + EOLN); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
             buffer.append(indenter.decrease());
         }
 
-        buffer.append("};" + EOLN);
+        buffer.append("};" + EOLN); //$NON-NLS-1$
 
         return buffer.toString();
     }
@@ -435,9 +437,9 @@
      */
     private String getOperationsMethod() {
         return (indenter.indent()
-                + "public java.rmi.server.Operation[] getOperations() {" + EOLN
+                + "public java.rmi.server.Operation[] getOperations() {" + EOLN //$NON-NLS-1$
                 + indenter.tIncrease()
-                + "return (java.rmi.server.Operation[]) operations.clone();"
+                + "return (java.rmi.server.Operation[]) operations.clone();" //$NON-NLS-1$
                 + EOLN + indenter.indent() + '}' + EOLN);
     }
 
@@ -449,12 +451,12 @@
      */
     private String getDispatchMethod() {
         StringBuffer buffer = new StringBuffer(indenter.indent()
-                + "public void dispatch(java.rmi.Remote obj, "
-                + "java.rmi.server.RemoteCall call, int opnum, long hash) "
-                + "throws java.lang.Exception {" + EOLN + indenter.hIncrease());
+                + "public void dispatch(java.rmi.Remote obj, " //$NON-NLS-1$
+                + "java.rmi.server.RemoteCall call, int opnum, long hash) " //$NON-NLS-1$
+                + "throws java.lang.Exception {" + EOLN + indenter.hIncrease()); //$NON-NLS-1$
 
         if (vCompat) {
-            buffer.append(indenter.indent() + "if (opnum < 0) {" + EOLN
+            buffer.append(indenter.indent() + "if (opnum < 0) {" + EOLN //$NON-NLS-1$
                     + indenter.increase());
 
             if (methodsExist) {
@@ -464,40 +466,40 @@
                 buffer.append('{' + EOLN + indenter.increase());
             }
 
-            buffer.append("throw new java.rmi.UnmarshalException("
-                    + "\"Invalid method hash: \" + hash);" + EOLN
+            buffer.append("throw new java.rmi.UnmarshalException(" //$NON-NLS-1$
+                    + "\"Invalid method hash: \" + hash);" + EOLN //$NON-NLS-1$
                     + indenter.decrease() + '}' + EOLN
-                    + (methodsExist ? (indenter.tDecrease() + "} else {") : "")
+                    + (methodsExist ? (indenter.tDecrease() + "} else {") : "") //$NON-NLS-1$ //$NON-NLS-2$
                     + EOLN);
         }
 
-        buffer.append(indenter.indent() + "if (hash != interfaceHash) {" + EOLN
+        buffer.append(indenter.indent() + "if (hash != interfaceHash) {" + EOLN //$NON-NLS-1$
                 + indenter.increase()
-                + "throw new java.rmi.server.SkeletonMismatchException(" + EOLN
+                + "throw new java.rmi.server.SkeletonMismatchException(" + EOLN //$NON-NLS-1$
                 + indenter.tIncrease(2)
-                + "\"Interface hash mismatch, expected: \" + interfaceHash"
-                + " + \", received: \" + hash);" + EOLN
+                + "\"Interface hash mismatch, expected: \" + interfaceHash" //$NON-NLS-1$
+                + " + \", received: \" + hash);" + EOLN //$NON-NLS-1$
                 + indenter.decrease() + '}' + EOLN + ((vCompat && methodsExist)
-                        ? (indenter.decrease() + '}' + EOLN) : "") + EOLN
-                + indenter.indent() + className + " server = "
-                    + '(' + className + ") obj;" + EOLN + EOLN);
+                        ? (indenter.decrease() + '}' + EOLN) : "") + EOLN //$NON-NLS-1$
+                + indenter.indent() + className + " server = " //$NON-NLS-1$
+                    + '(' + className + ") obj;" + EOLN + EOLN); //$NON-NLS-1$
 
         if (methodsExist) {
-            buffer.append(indenter.indent() + "switch (opnum) {" + EOLN);
+            buffer.append(indenter.indent() + "switch (opnum) {" + EOLN); //$NON-NLS-1$
 
             for (Iterator i = methods.iterator(); i.hasNext(); ) {
                 buffer.append(EOLN + ((MethodStub) i.next()).getDispatchCase());
             }
 
-            buffer.append(EOLN + indenter.indent() + "default:" + EOLN);
+            buffer.append(EOLN + indenter.indent() + "default:" + EOLN); //$NON-NLS-1$
 
             indenter.increase();
         }
 
         buffer.append(indenter.indent()
-                + "throw new java.rmi.UnmarshalException("
-                + "\"Invalid method number: \" + opnum);" + EOLN
-                + (methodsExist ? (indenter.decrease() + '}' + EOLN) : "")
+                + "throw new java.rmi.UnmarshalException(" //$NON-NLS-1$
+                + "\"Invalid method number: \" + opnum);" + EOLN //$NON-NLS-1$
+                + (methodsExist ? (indenter.decrease() + '}' + EOLN) : "") //$NON-NLS-1$
                 + indenter.decrease() + '}' + EOLN);
 
         return buffer.toString();
@@ -527,15 +529,15 @@
      */
     private String getStaticInitializationBlock() {
         StringBuffer buffer = new StringBuffer(indenter.indent()
-                + "static {" + EOLN + indenter.increase() + "try {" + EOLN
+                + "static {" + EOLN + indenter.increase() + "try {" + EOLN //$NON-NLS-1$ //$NON-NLS-2$
                 + indenter.hIncrease());
 
         if (vCompat) {
             buffer.append(indenter.indent()
-                    + "java.rmi.server.RemoteRef.class.getMethod(\"invoke\", "
-                    + "new java.lang.Class[] {java.rmi.Remote.class, "
-                    + "java.lang.reflect.Method.class, java.lang.Object[].class"
-                    + ", long.class});" + EOLN + EOLN);
+                    + "java.rmi.server.RemoteRef.class.getMethod(\"invoke\", " //$NON-NLS-1$
+                    + "new java.lang.Class[] {java.rmi.Remote.class, " //$NON-NLS-1$
+                    + "java.lang.reflect.Method.class, java.lang.Object[].class" //$NON-NLS-1$
+                    + ", long.class});" + EOLN + EOLN); //$NON-NLS-1$
         }
 
         for (Iterator i = methods.iterator(); i.hasNext(); ) {
@@ -543,16 +545,16 @@
         }
 
         buffer.append((vCompat ? (EOLN + indenter.indent() + useNewInvoke
-                + " = true;" + EOLN) : "") + indenter.decrease()
-                + "} catch (java.lang.NoSuchMethodException e) {" + EOLN
+                + " = true;" + EOLN) : "") + indenter.decrease() //$NON-NLS-1$ //$NON-NLS-2$
+                + "} catch (java.lang.NoSuchMethodException e) {" + EOLN //$NON-NLS-1$
                 + indenter.increase()
-                + (vCompat ? (useNewInvoke + " = false;")
-                        : ("throw new java.lang.NoSuchMethodError(" + EOLN
+                + (vCompat ? (useNewInvoke + " = false;") //$NON-NLS-1$
+                        : ("throw new java.lang.NoSuchMethodError(" + EOLN //$NON-NLS-1$
                                 + indenter.tIncrease(2)
-                                + "\"Stub class initialization failed: "
+                                + "\"Stub class initialization failed: " //$NON-NLS-1$
                                 + ((packageName != null)
-                                        ? (packageName + '.') : "")
-                                + stubName + "\");")) + EOLN
+                                        ? (packageName + '.') : "") //$NON-NLS-1$
+                                + stubName + "\");")) + EOLN //$NON-NLS-1$
                 + indenter.decrease() + '}' + EOLN
                 + indenter.decrease() + '}' + EOLN);
 
@@ -569,14 +571,14 @@
         StringBuffer buffer = new StringBuffer();
 
         if (v11) {
-            buffer.append(indenter.indent() + "public " + stubName
-                    + "() {" + EOLN + indenter.tIncrease() + "super();" + EOLN
+            buffer.append(indenter.indent() + "public " + stubName //$NON-NLS-1$
+                    + "() {" + EOLN + indenter.tIncrease() + "super();" + EOLN //$NON-NLS-1$ //$NON-NLS-2$
                     + indenter.indent() + '}' + EOLN + EOLN);
         }
 
-        buffer.append(indenter.indent() + "public " + stubName
-                + "(java.rmi.server.RemoteRef ref) {" + EOLN
-                + indenter.tIncrease() + "super(ref);" + EOLN
+        buffer.append(indenter.indent() + "public " + stubName //$NON-NLS-1$
+                + "(java.rmi.server.RemoteRef ref) {" + EOLN //$NON-NLS-1$
+                + indenter.tIncrease() + "super(ref);" + EOLN //$NON-NLS-1$
                 + indenter.indent() + '}' + EOLN);
 
         return buffer.toString();
@@ -754,7 +756,7 @@
          */
         String getOpsArrayElement() {
             return (indenter.indent() +
-                        "new java.rmi.server.Operation(\"" + longSign + "\")");
+                        "new java.rmi.server.Operation(\"" + longSign + "\")"); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         /**
@@ -764,9 +766,9 @@
          * @return  Hash checking code for this method..
          */
         String getHashCheck() {
-            return ("if (hash == " + hash + "L) {" + EOLN
-                    + indenter.tIncrease() + "opnum = " + number + ';' + EOLN
-                    + indenter.indent() + "} else ");
+            return ("if (hash == " + hash + "L) {" + EOLN //$NON-NLS-1$ //$NON-NLS-2$
+                    + indenter.tIncrease() + "opnum = " + number + ';' + EOLN //$NON-NLS-1$
+                    + indenter.indent() + "} else "); //$NON-NLS-1$
         }
 
         /**
@@ -777,7 +779,7 @@
          */
         String getDispatchCase() {
             StringBuffer buffer = new StringBuffer(indenter.indent()
-                    + "case " + number + ": {    // " + shortSign + EOLN + EOLN
+                    + "case " + number + ": {    // " + shortSign + EOLN + EOLN //$NON-NLS-1$ //$NON-NLS-2$
                     + indenter.hIncrease());
 
             if (numParams > 0) {
@@ -788,15 +790,15 @@
                 }
 
                 // Access input stream.
-                buffer.append(EOLN + indenter.indent() + "try {" + EOLN
-                        + indenter.increase() + "java.io.ObjectInput "
-                        + inputStreamName + " = call.getInputStream();" + EOLN);
+                buffer.append(EOLN + indenter.indent() + "try {" + EOLN //$NON-NLS-1$
+                        + indenter.increase() + "java.io.ObjectInput " //$NON-NLS-1$
+                        + inputStreamName + " = call.getInputStream();" + EOLN); //$NON-NLS-1$
 
                 boolean objectParametersExist = false;
 
                 // Add parameters initialization, read them from the stream.
                 for (int i = 0; i < numParams; i++) {
-                    buffer.append(indenter.indent() + paramNames[i] + " = "
+                    buffer.append(indenter.indent() + paramNames[i] + " = " //$NON-NLS-1$
                             + RmicUtil.getReadObjectString(parameters[i],
                                     inputStreamName) + ';' + EOLN);
 
@@ -807,46 +809,46 @@
 
                 // Add catch block.
                 buffer.append(indenter.tDecrease()
-                        + "} catch (java.io.IOException e) {" + EOLN
+                        + "} catch (java.io.IOException e) {" + EOLN //$NON-NLS-1$
                         + indenter.indent()
-                        + "throw new java.rmi.UnmarshalException("
-                        + "\"Error unmarshalling arguments\", e);" + EOLN
+                        + "throw new java.rmi.UnmarshalException(" //$NON-NLS-1$
+                        + "\"Error unmarshalling arguments\", e);" + EOLN //$NON-NLS-1$
                         + (objectParametersExist ? (indenter.tDecrease()
-                        + "} catch (java.lang.ClassNotFoundException e) {"
+                        + "} catch (java.lang.ClassNotFoundException e) {" //$NON-NLS-1$
                         + EOLN + indenter.indent()
-                        + "throw new java.rmi.UnmarshalException("
-                        + "\"Error unmarshalling arguments\", e);" + EOLN) : "")
-                        + indenter.tDecrease() + "} finally {" + EOLN);
+                        + "throw new java.rmi.UnmarshalException(" //$NON-NLS-1$
+                        + "\"Error unmarshalling arguments\", e);" + EOLN) : "") //$NON-NLS-1$ //$NON-NLS-2$
+                        + indenter.tDecrease() + "} finally {" + EOLN); //$NON-NLS-1$
             }
             // Release input stream.
             buffer.append(indenter.indent()
-                    + "call.releaseInputStream();" + EOLN);
+                    + "call.releaseInputStream();" + EOLN); //$NON-NLS-1$
 
             if (numParams > 0) {
                 buffer.append(indenter.decrease() + '}' + EOLN);
             }
 
             buffer.append(EOLN + indenter.indent() + ((retType != void.class)
-                    ? (retTypeName + ' ' + retVarName + " = ") : "")
-                    + "server." + name + '(');
+                    ? (retTypeName + ' ' + retVarName + " = ") : "") //$NON-NLS-1$ //$NON-NLS-2$
+                    + "server." + name + '('); //$NON-NLS-1$
 
             for (int i = 0; i < numParams; i++) {
-                buffer.append(((i > 0) ? ", " : "") + paramNames[i]);
+                buffer.append(((i > 0) ? ", " : "") + paramNames[i]); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
-            buffer.append(");" + EOLN + EOLN + indenter.indent() + "try {"
+            buffer.append(");" + EOLN + EOLN + indenter.indent() + "try {" //$NON-NLS-1$ //$NON-NLS-2$
                     + EOLN + indenter.increase() + ((retType != void.class)
-                    ? ("java.io.ObjectOutput " + outputStreamName + " = ") : "")
-                    + "call.getResultStream(true);" + EOLN
+                    ? ("java.io.ObjectOutput " + outputStreamName + " = ") : "") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                    + "call.getResultStream(true);" + EOLN //$NON-NLS-1$
                     + ((retType != void.class) ? (indenter.indent()
                             + RmicUtil.getWriteObjectString(retType, retVarName,
-                                    outputStreamName) + ';' + EOLN) : "")
-                    + indenter.decrease() + "} catch (java.io.IOException e) {"
+                                    outputStreamName) + ';' + EOLN) : "") //$NON-NLS-1$
+                    + indenter.decrease() + "} catch (java.io.IOException e) {" //$NON-NLS-1$
                     + EOLN + indenter.tIncrease()
-                    + "throw new java.rmi.MarshalException("
-                    + "\"Error marshalling return\", e);" + EOLN
+                    + "throw new java.rmi.MarshalException(" //$NON-NLS-1$
+                    + "\"Error marshalling return\", e);" + EOLN //$NON-NLS-1$
                     + indenter.indent() + '}' + EOLN + EOLN
-                    + indenter.indent() + "break;" + EOLN
+                    + indenter.indent() + "break;" + EOLN //$NON-NLS-1$
                     + indenter.decrease() + '}' + EOLN);
 
             return buffer.toString();
@@ -860,7 +862,7 @@
          */
         String getVariableDecl() {
             return (indenter.indent()
-                    + "private static java.lang.reflect.Method"
+                    + "private static java.lang.reflect.Method" //$NON-NLS-1$
                     + ' ' + varName + ';' + EOLN);
         }
 
@@ -872,18 +874,18 @@
          */
         String getVariableInit() {
             StringBuffer buffer = new StringBuffer(indenter.indent()
-                    + varName + " = " + interfaceName + ".class.getMethod(\""
-                    + name + "\", new java.lang.Class[] {");
+                    + varName + " = " + interfaceName + ".class.getMethod(\"" //$NON-NLS-1$ //$NON-NLS-2$
+                    + name + "\", new java.lang.Class[] {"); //$NON-NLS-1$
 
             if (numParams > 0) {
                 // Write method parameters.
                 for (int i = 0; i < numParams; i++) {
-                    buffer.append(((i > 0) ? ", " : "")
-                            + paramClassNames[i] + ".class");
+                    buffer.append(((i > 0) ? ", " : "") //$NON-NLS-1$ //$NON-NLS-2$
+                            + paramClassNames[i] + ".class"); //$NON-NLS-1$
                 }
             }
 
-            buffer.append("});" + EOLN);
+            buffer.append("});" + EOLN); //$NON-NLS-1$
 
             return buffer.toString();
         }
@@ -896,13 +898,13 @@
          */
         String getStubImpl() {
             return (getStubImplHeader()
-                    + (vCompat ? (indenter.indent() + "if (" + useNewInvoke
-                            + ") {" + EOLN + indenter.hIncrease()) : "")
-                    + (v12 ? getStubImplCodeV12() : "") + (vCompat
-                            ? (indenter.tDecrease() + "} else {" + EOLN) : "")
-                    + (v11 ? getStubImplCodeV11() : "")
-                    + (vCompat ? (indenter.decrease() + '}' + EOLN) : "")
-                    + (throwsException ? "" : (indenter.hDecrease()
+                    + (vCompat ? (indenter.indent() + "if (" + useNewInvoke //$NON-NLS-1$
+                            + ") {" + EOLN + indenter.hIncrease()) : "") //$NON-NLS-1$ //$NON-NLS-2$
+                    + (v12 ? getStubImplCodeV12() : "") + (vCompat //$NON-NLS-1$
+                            ? (indenter.tDecrease() + "} else {" + EOLN) : "") //$NON-NLS-1$ //$NON-NLS-2$
+                    + (v11 ? getStubImplCodeV11() : "") //$NON-NLS-1$
+                    + (vCompat ? (indenter.decrease() + '}' + EOLN) : "") //$NON-NLS-1$
+                    + (throwsException ? "" : (indenter.hDecrease() //$NON-NLS-1$
                             + getStubImplCatchBlock()))
                     + indenter.decrease() + '}' + EOLN);
         }
@@ -915,27 +917,27 @@
          */
         private String getStubImplHeader() {
             StringBuffer buffer = new StringBuffer(indenter.indent()
-                    + "// Implementation of " + shortSign + EOLN
-                    + indenter.indent() + "public " + retTypeName
+                    + "// Implementation of " + shortSign + EOLN //$NON-NLS-1$
+                    + indenter.indent() + "public " + retTypeName //$NON-NLS-1$
                     + ' ' + name + '(');
 
             // Write method parameters.
             for (int i = 0; i < numParams; i++) {
-                buffer.append(((i > 0) ? ", " : "")
+                buffer.append(((i > 0) ? ", " : "") //$NON-NLS-1$ //$NON-NLS-2$
                         + paramClassNames[i] + ' ' + paramNames[i]);
             }
 
-            buffer.append(')' + EOLN + indenter.tIncrease(2) + "throws ");
+            buffer.append(')' + EOLN + indenter.tIncrease(2) + "throws "); //$NON-NLS-1$
 
             // Write exceptions declared thrown.
             for (Iterator i = exceptions.iterator(); i.hasNext(); ) {
                 buffer.append(((Class) i.next()).getName()
-                        + (i.hasNext() ? ", " : "" ));
+                        + (i.hasNext() ? ", " : "" )); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
-            buffer.append(" {" + EOLN + indenter.hIncrease()
-                    + (throwsException ? "" : (indenter.indent()
-                            + "try {" + EOLN + indenter.hIncrease())));
+            buffer.append(" {" + EOLN + indenter.hIncrease() //$NON-NLS-1$
+                    + (throwsException ? "" : (indenter.indent() //$NON-NLS-1$
+                            + "try {" + EOLN + indenter.hIncrease()))); //$NON-NLS-1$
 
             return buffer.toString();
         }
@@ -948,15 +950,15 @@
          */
         private String getStubImplCodeV11() {
             StringBuffer buffer = new StringBuffer(indenter.indent()
-                    + "java.rmi.server.RemoteCall call = "
-                    + "ref.newCall((java.rmi.server.RemoteObject) this, "
-                    + "operations, " + number + ", " + interfaceHashVarName
-                    + ");" + EOLN);
+                    + "java.rmi.server.RemoteCall call = " //$NON-NLS-1$
+                    + "ref.newCall((java.rmi.server.RemoteObject) this, " //$NON-NLS-1$
+                    + "operations, " + number + ", " + interfaceHashVarName //$NON-NLS-1$ //$NON-NLS-2$
+                    + ");" + EOLN); //$NON-NLS-1$
 
             if (numParams > 0) {
-                buffer.append(EOLN + indenter.indent() + "try {" + EOLN
-                    + indenter.increase() + "java.io.ObjectOutput "
-                    + outputStreamName + " = call.getOutputStream();" + EOLN);
+                buffer.append(EOLN + indenter.indent() + "try {" + EOLN //$NON-NLS-1$
+                    + indenter.increase() + "java.io.ObjectOutput " //$NON-NLS-1$
+                    + outputStreamName + " = call.getOutputStream();" + EOLN); //$NON-NLS-1$
 
                 for (int i = 0; i < numParams; i++) {
                     buffer.append(indenter.indent()
@@ -966,42 +968,42 @@
                 }
 
                 buffer.append(indenter.decrease()
-                        + "} catch (java.io.IOException e) {" + EOLN
+                        + "} catch (java.io.IOException e) {" + EOLN //$NON-NLS-1$
                         + indenter.tIncrease()
-                        + "throw new java.rmi.MarshalException("
-                        + "\"Error marshalling arguments\", e);" + EOLN
+                        + "throw new java.rmi.MarshalException(" //$NON-NLS-1$
+                        + "\"Error marshalling arguments\", e);" + EOLN //$NON-NLS-1$
                         + indenter.indent() + '}' + EOLN);
             }
 
             buffer.append(EOLN + indenter.indent()
-                    + "ref.invoke(call);" + EOLN);
+                    + "ref.invoke(call);" + EOLN); //$NON-NLS-1$
 
             if (retType != void.class) {
                 buffer.append(EOLN + indenter.indent()
                         + retTypeName + ' ' + retVarName + ';' + EOLN + EOLN
-                        + indenter.indent() + "try {" + EOLN
-                        + indenter.increase() + "java.io.ObjectInput "
-                        + inputStreamName + " = call.getInputStream();" + EOLN
-                        + indenter.indent() + retVarName + " = "
+                        + indenter.indent() + "try {" + EOLN //$NON-NLS-1$
+                        + indenter.increase() + "java.io.ObjectInput " //$NON-NLS-1$
+                        + inputStreamName + " = call.getInputStream();" + EOLN //$NON-NLS-1$
+                        + indenter.indent() + retVarName + " = " //$NON-NLS-1$
                         + RmicUtil.getReadObjectString(retType, inputStreamName)
                         + ';' + EOLN + indenter.decrease()
-                        + "} catch (java.io.IOException e) {" + EOLN
+                        + "} catch (java.io.IOException e) {" + EOLN //$NON-NLS-1$
                         + indenter.tIncrease()
-                        + "throw new java.rmi.UnmarshalException("
-                        + "\"Error unmarshalling return value\", e);" + EOLN
+                        + "throw new java.rmi.UnmarshalException(" //$NON-NLS-1$
+                        + "\"Error unmarshalling return value\", e);" + EOLN //$NON-NLS-1$
                         + (!retType.isPrimitive() ? (indenter.indent()
-                        + "} catch (java.lang.ClassNotFoundException e) {"
+                        + "} catch (java.lang.ClassNotFoundException e) {" //$NON-NLS-1$
                         + EOLN + indenter.tIncrease()
-                        + "throw new java.rmi.UnmarshalException("
-                        + "\"Error unmarshalling return value\", e);" + EOLN)
-                        : "") + indenter.indent() + "} finally {" + EOLN
-                        + indenter.tIncrease() + "ref.done(call);" + EOLN
+                        + "throw new java.rmi.UnmarshalException(" //$NON-NLS-1$
+                        + "\"Error unmarshalling return value\", e);" + EOLN) //$NON-NLS-1$
+                        : "") + indenter.indent() + "} finally {" + EOLN //$NON-NLS-1$ //$NON-NLS-2$
+                        + indenter.tIncrease() + "ref.done(call);" + EOLN //$NON-NLS-1$
                         + indenter.indent() + '}' + EOLN + EOLN
-                        + indenter.indent() + "return " + retVarName + ';'
+                        + indenter.indent() + "return " + retVarName + ';' //$NON-NLS-1$
                         + EOLN);
             } else {
                 buffer.append(EOLN + indenter.indent()
-                        + "ref.done(call);" + EOLN);
+                        + "ref.done(call);" + EOLN); //$NON-NLS-1$
             }
 
             return buffer.toString();
@@ -1017,30 +1019,30 @@
             StringBuffer buffer = new StringBuffer(indenter.indent());
 
             if (retType != void.class) {
-                buffer.append("java.lang.Object " + retVarName + " = ");
+                buffer.append("java.lang.Object " + retVarName + " = "); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
-            buffer.append("ref.invoke(this, " + varName + ", ");
+            buffer.append("ref.invoke(this, " + varName + ", "); //$NON-NLS-1$ //$NON-NLS-2$
 
             if (numParams > 0) {
-                buffer.append("new java.lang.Object[] {");
+                buffer.append("new java.lang.Object[] {"); //$NON-NLS-1$
 
                 // Write invocation parameters.
                 for (int i = 0; i < numParams; i++) {
-                    buffer.append(((i > 0) ? ", " : "")
+                    buffer.append(((i > 0) ? ", " : "") //$NON-NLS-1$ //$NON-NLS-2$
                             + RmicUtil.getObjectParameterString(
                                     parameters[i], paramNames[i]));
                 }
                 buffer.append('}');
             } else {
-                buffer.append("null");
+                buffer.append("null"); //$NON-NLS-1$
             }
 
-            buffer.append(", " + hash + "L);" + EOLN);
+            buffer.append(", " + hash + "L);" + EOLN); //$NON-NLS-1$ //$NON-NLS-2$
 
             // Write return statement.
             if (retType != void.class) {
-                buffer.append(indenter.indent() + "return "
+                buffer.append(indenter.indent() + "return " //$NON-NLS-1$
                         + RmicUtil.getReturnObjectString(retType, retVarName)
                         + ';' + EOLN);
             }
@@ -1058,16 +1060,16 @@
             StringBuffer buffer = new StringBuffer();
 
             for (Iterator i = catches.iterator(); i.hasNext(); ) {
-                buffer.append(indenter.indent() + "} catch ("
-                        + ((Class) i.next()).getName() + " e) {" + EOLN
-                        + indenter.tIncrease() + "throw e;" + EOLN);
+                buffer.append(indenter.indent() + "} catch (" //$NON-NLS-1$
+                        + ((Class) i.next()).getName() + " e) {" + EOLN //$NON-NLS-1$
+                        + indenter.tIncrease() + "throw e;" + EOLN); //$NON-NLS-1$
             }
 
             buffer.append(indenter.indent()
-                    + "} catch (java.lang.Exception e) {" + EOLN
+                    + "} catch (java.lang.Exception e) {" + EOLN //$NON-NLS-1$
                     + indenter.tIncrease()
-                    + "throw new java.rmi.UnexpectedException("
-                    + "\"Undeclared checked exception\", e);" + EOLN
+                    + "throw new java.rmi.UnexpectedException(" //$NON-NLS-1$
+                    + "\"Undeclared checked exception\", e);" + EOLN //$NON-NLS-1$
                     + indenter.indent() + '}' + EOLN);
 
             return buffer.toString();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java Fri Oct  6 03:15:51 2006
@@ -22,6 +22,8 @@
  */
 package org.apache.harmony.rmi.compiler;
 
+import org.apache.harmony.rmi.internal.nls.Messages;
+
 
 /**
  * Provides dynamic 4-space indents usable for source code generation.
@@ -39,7 +41,7 @@
     /**
      * String used for indentation.
      */
-    private final String stepString = "    ";
+    private final String stepString = "    "; //$NON-NLS-1$
 
     /**
      * Length of {@linkplain #stepString indentation string}.
@@ -149,7 +151,7 @@
      */
     String hIncrease(int steps) {
         increase(steps);
-        return "";
+        return ""; //$NON-NLS-1$
     }
 
     /**
@@ -178,7 +180,7 @@
      */
     String hDecrease(int steps) throws IndexOutOfBoundsException {
         decrease(steps);
-        return "";
+        return ""; //$NON-NLS-1$
     }
 
     /**
@@ -251,9 +253,9 @@
      */
     String assertEmpty() throws IllegalStateException {
         if (currentIndent.length() != 0) {
-            throw new IllegalStateException(
-                    "Indenter assertion failed: current indent is not empty");
+            // rmi.56=Indenter assertion failed: current indent is not empty
+            throw new IllegalStateException(Messages.getString("rmi.56")); //$NON-NLS-1$
         }
-        return "";
+        return ""; //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Main.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Main.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Main.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Main.java Fri Oct  6 03:15:51 2006
@@ -22,6 +22,8 @@
  */
 package org.apache.harmony.rmi.compiler;
 
+import org.apache.harmony.rmi.internal.nls.Messages;
+
 
 /**
  * Launcher engine for RMI Compiler.
@@ -46,13 +48,15 @@
             if ((message != null) && message.startsWith(EOLN)) {
                 System.out.println(message);
             } else {
-                System.out.println("RMIC Error: "
-                        + ((message != null) ? message : ""));
+                // rmi.console.18=RMIC Error: {0}
+                System.out.println(Messages.getString("rmi.console.18", //$NON-NLS-1$
+                        ((message != null) ? message : ""))); //$NON-NLS-1$
                 e.printStackTrace(System.out);
                 System.exit(-1);
             }
         } catch (Throwable e) {
-            System.out.println("RMIC Error: Unexpected exception:" + e);
+            // rmi.console.19=RMIC Error: Unexpected exception:{0}
+            System.out.println(Messages.getString("rmi.console.19", e)); //$NON-NLS-1$
             e.printStackTrace(System.out);
             System.exit(-1);
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RMICompiler.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RMICompiler.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RMICompiler.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RMICompiler.java Fri Oct  6 03:15:51 2006
@@ -34,6 +34,7 @@
 import org.apache.harmony.rmi.common.JavaCompiler;
 import org.apache.harmony.rmi.common.JavaCompilerException;
 import org.apache.harmony.rmi.common.RMIUtil;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -339,7 +340,7 @@
         boolean verbose = false;
         boolean depend = false;
         boolean optionsPresent = (numArgs > 0);
-        String destinationDir = ".";
+        String destinationDir = "."; //$NON-NLS-1$
 
         ArrayList javacOptionsList = new ArrayList();
 
@@ -387,8 +388,8 @@
                     // If parameter is available,
                     // add options to javacOptionsList.
                     String target = args[++i].intern();
-                    String source = (((target == "1.1") || (target == "1.2"))
-                            ? "1.3" : target);
+                    String source = (((target == "1.1") || (target == "1.2")) //$NON-NLS-1$ //$NON-NLS-2$
+                            ? "1.3" : target); //$NON-NLS-1$
 
                     javacOptionsList.add(optionSource);
                     javacOptionsList.add(source);
@@ -484,7 +485,8 @@
         // Print warnings.
         if (warnings) {
             for (Iterator i = warningTags.values().iterator(); i.hasNext(); ) {
-                System.err.println("WARNING: " + i.next());
+                // rmi.console.1A=WARNING: {0}
+                System.err.println(Messages.getString("rmi.console.1A", i.next())); //$NON-NLS-1$
             }
         }
 
@@ -579,11 +581,13 @@
                         cls = Class.forName(className);
                         classes[i] = cls;
                     } catch (ClassNotFoundException e) {
+                        // rmi.55=Class not found: {0}
                         throw new RMICompilerException(
-                                "Class not found: " + e.getMessage(), e);
+                                Messages.getString("rmi.55", e.getMessage()), e); //$NON-NLS-1$
                     } catch (LinkageError e) {
+                        // rmi.57=Class loading error: {0}
                         throw new RMICompilerException(
-                                "Class loading error: " + e.getMessage(), e);
+                                Messages.getString("rmi.57", e.getMessage()), e); //$NON-NLS-1$
                     }
                 }
 
@@ -623,8 +627,9 @@
                     writer.write(stub.getStubSource());
                     writer.close();
                 } catch (IOException e) {
+                    // rmi.58=Can't write file {0}
                     throw new RMICompilerException(
-                            "Can't write file " + stubFile.getName(), e);
+                            Messages.getString("rmi.58", stubFile.getName()), e); //$NON-NLS-1$
                 }
 
                 if (version != VERSION_V12) {
@@ -634,8 +639,9 @@
                         writer.write(stub.getSkeletonSource());
                         writer.close();
                     } catch (IOException e) {
+                        // rmi.58=Can't write file {0}
                         throw new RMICompilerException(
-                                "Can't write file " + skelFile.getName(), e);
+                                Messages.getString("rmi.58", skelFile.getName()), e); //$NON-NLS-1$
                     }
                 }
             }
@@ -661,10 +667,12 @@
                         .compile(javacOptions, files);
 
                 if (ret != 0) {
-                    throw new RMICompilerException("Javac failed, code " + ret);
+                    // rmi.59=Javac failed, code {0}
+                    throw new RMICompilerException(Messages.getString("rmi.59", ret)); //$NON-NLS-1$
                 }
             } catch (JavaCompilerException e) {
-                throw new RMICompilerException("Can't run Javac: " + e, e);
+                // rmi.5A=Can't run Javac: {0}
+                throw new RMICompilerException(Messages.getString("rmi.5A", e), e); //$NON-NLS-1$
             }
         } finally {
 
@@ -765,7 +773,7 @@
      */
     private static void error(String message, String arg)
             throws RMICompilerException {
-        error(message.replaceAll("%s", arg));
+        error(message.replaceAll("%s", arg)); //$NON-NLS-1$
     }
 
     /**
@@ -782,7 +790,7 @@
      *              by <code>%s</code> substrings.
      */
     private void addWarning(String tag, String message) {
-        warningTags.put(tag, message.replaceAll("%s", tag));
+        warningTags.put(tag, message.replaceAll("%s", tag)); //$NON-NLS-1$
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicConstants.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicConstants.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicConstants.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicConstants.java Fri Oct  6 03:15:51 2006
@@ -35,67 +35,67 @@
      * System-dependent end-of-line string
      * {@link System#getProperty(String) System.getProperty("line.separator")}.
      */
-    String EOLN = System.getProperty("line.separator");
+    String EOLN = System.getProperty("line.separator"); //$NON-NLS-1$
 
     /**
      * Stub classes name suffix (<code>_Stub</code>).
      */
-    String stubSuffix = "_Stub";
+    String stubSuffix = "_Stub"; //$NON-NLS-1$
 
     /**
      * Skeleton classes name suffix (<code>_Skel</code>).
      */
-    String skelSuffix = "_Skel";
+    String skelSuffix = "_Skel"; //$NON-NLS-1$
 
     /**
      * Java source files name suffix (<code>.java</code>).
      */
-    String javaSuffix = ".java";
+    String javaSuffix = ".java"; //$NON-NLS-1$
 
     /**
      * Java class files name suffix (<code>.class</code>).
      */
-    String classSuffix = ".class";
+    String classSuffix = ".class"; //$NON-NLS-1$
 
     /**
      * Method variables name prefix.
      */
-    String methodVarPrefix = "$method_";
+    String methodVarPrefix = "$method_"; //$NON-NLS-1$
 
     /**
      * Parameters name prefix.
      */
-    String paramPrefix = "$param_";
+    String paramPrefix = "$param_"; //$NON-NLS-1$
 
     /**
      * Array type prefix in parameter name.
      */
-    String arrayPrefix = "arrayOf_";
+    String arrayPrefix = "arrayOf_"; //$NON-NLS-1$
 
     /**
      * Return result variable name.
      */
-    String retVarName = "$result";
+    String retVarName = "$result"; //$NON-NLS-1$
 
     /**
      * interfaceHash variable name.
      */
-    String interfaceHashVarName = "interfaceHash";
+    String interfaceHashVarName = "interfaceHash"; //$NON-NLS-1$
 
     /**
      * useNewInvoke variable name.
      */
-    String useNewInvoke = "useNewInvoke";
+    String useNewInvoke = "useNewInvoke"; //$NON-NLS-1$
 
     /**
      * Input object stream name.
      */
-    String inputStreamName = "in";
+    String inputStreamName = "in"; //$NON-NLS-1$
 
     /**
      * Output object stream name.
      */
-    String outputStreamName = "out";
+    String outputStreamName = "out"; //$NON-NLS-1$
 
     /**
      * Version was not set, initial version value.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicStrings.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicStrings.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicStrings.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicStrings.java Fri Oct  6 03:15:51 2006
@@ -22,6 +22,8 @@
  */
 package org.apache.harmony.rmi.compiler;
 
+import org.apache.harmony.rmi.internal.nls.Messages;
+
 
 /**
  * This interface contains command line options and other textual constants
@@ -35,82 +37,82 @@
     /**
      * Options prefix character.
      */
-    String optionPrefix = "-";
+    String optionPrefix = "-"; //$NON-NLS-1$
 
     /**
      * <code>-v1.1</code> option.
      */
-    String optionV11 = optionPrefix + "v1.1";
+    String optionV11 = optionPrefix + "v1.1"; //$NON-NLS-1$
 
     /**
      * <code>-v1.2</code> option.
      */
-    String optionV12 = optionPrefix + "v1.2";
+    String optionV12 = optionPrefix + "v1.2"; //$NON-NLS-1$
 
     /**
      * <code>-vcompat</code> option.
      */
-    String optionVCompat = optionPrefix + "vcompat";
+    String optionVCompat = optionPrefix + "vcompat"; //$NON-NLS-1$
 
     /**
      * <code>-idl</code> option.
      */
-    String optionIDL = optionPrefix + "idl";
+    String optionIDL = optionPrefix + "idl"; //$NON-NLS-1$
 
     /**
      * <code>-iiop</code> option.
      */
-    String optionIIOP = optionPrefix + "iiop";
+    String optionIIOP = optionPrefix + "iiop"; //$NON-NLS-1$
 
     /**
      * <code>-source</code> option for Java Compiler.
      */
-    String optionSource = optionPrefix + "source";
+    String optionSource = optionPrefix + "source"; //$NON-NLS-1$
 
     /**
      * <code>-target</code> option.
      */
-    String optionTarget = optionPrefix + "target";
+    String optionTarget = optionPrefix + "target"; //$NON-NLS-1$
 
     /**
      * <code>-keep</code> option.
      */
-    String optionKeep = optionPrefix + "keep";
+    String optionKeep = optionPrefix + "keep"; //$NON-NLS-1$
 
     /**
      * <code>-keepgenerated</code> option.
      */
-    String optionKeepGenerated = optionPrefix + "keepgenerated";
+    String optionKeepGenerated = optionPrefix + "keepgenerated"; //$NON-NLS-1$
 
     /**
      * <code>-always</code> option.
      */
-    String optionAlways = optionPrefix + "always";
+    String optionAlways = optionPrefix + "always"; //$NON-NLS-1$
 
     /**
      * <code>-alwaysgenerate</code> option.
      */
-    String optionAlwaysGenerate = optionPrefix + "alwaysgenerate";
+    String optionAlwaysGenerate = optionPrefix + "alwaysgenerate"; //$NON-NLS-1$
 
     /**
      * <code>-factory</code> option.
      */
-    String optionFactory = optionPrefix + "factory";
+    String optionFactory = optionPrefix + "factory"; //$NON-NLS-1$
 
     /**
      * <code>-noValueMethods</code> option.
      */
-    String optionNoValueMethods = optionPrefix + "noValueMethods";
+    String optionNoValueMethods = optionPrefix + "noValueMethods"; //$NON-NLS-1$
 
     /**
      * <code>-nolocalstubs</code> option.
      */
-    String optionNoLocalStubs = optionPrefix + "nolocalstubs";
+    String optionNoLocalStubs = optionPrefix + "nolocalstubs"; //$NON-NLS-1$
 
     /**
      * <code>-poa</code> option.
      */
-    String optionPOA = optionPrefix + "poa";
+    String optionPOA = optionPrefix + "poa"; //$NON-NLS-1$
 
     /**
      * <code>-g</code> option.
@@ -125,32 +127,32 @@
     /**
      * <code>-nowarn</code> option.
      */
-    String optionNoWarnings = optionPrefix + "nowarn";
+    String optionNoWarnings = optionPrefix + "nowarn"; //$NON-NLS-1$
 
     /**
      * <code>-nowrite</code> option.
      */
-    String optionNoWrite = optionPrefix + "nowrite";
+    String optionNoWrite = optionPrefix + "nowrite"; //$NON-NLS-1$
 
     /**
      * <code>-verbose</code> option.
      */
-    String optionVerbose = optionPrefix + "verbose";
+    String optionVerbose = optionPrefix + "verbose"; //$NON-NLS-1$
 
     /**
      * <code>-depend</code> option.
      */
-    String optionDepend = optionPrefix + "depend";
+    String optionDepend = optionPrefix + "depend"; //$NON-NLS-1$
 
     /**
      * <code>-idlModule</code> option.
      */
-    String optionIdlModule = optionPrefix + "idlModule";
+    String optionIdlModule = optionPrefix + "idlModule"; //$NON-NLS-1$
 
     /**
      * <code>-idlFile</code> option.
      */
-    String optionIdlFile = optionPrefix + "idlFile";
+    String optionIdlFile = optionPrefix + "idlFile"; //$NON-NLS-1$
 
     /**
      * <code>-d</code> option.
@@ -160,22 +162,22 @@
     /**
      * <code>-classpath</code> option.
      */
-    String optionClassPath = optionPrefix + "classpath";
+    String optionClassPath = optionPrefix + "classpath"; //$NON-NLS-1$
 
     /**
      * <code>-cp</code> option.
      */
-    String optionCP = optionPrefix + "cp";
+    String optionCP = optionPrefix + "cp"; //$NON-NLS-1$
 
     /**
      * <code>-bootclasspath</code> option.
      */
-    String optionBootClassPath = optionPrefix + "bootclasspath";
+    String optionBootClassPath = optionPrefix + "bootclasspath"; //$NON-NLS-1$
 
     /**
      * <code>-extdirs</code> option.
      */
-    String optionExtDirs = optionPrefix + "extdirs";
+    String optionExtDirs = optionPrefix + "extdirs"; //$NON-NLS-1$
 
     /**
      * <code>-J</code> option.
@@ -190,93 +192,143 @@
     /**
      * RMI Compiler usage text.
      */
-    String usageText = "Usage: rmic <options> <class names>" + EOLN
-            + EOLN + "Options:" + EOLN + "  " + optionV11 + "              "
-            + "Create stubs/skeletons for 1.1 stub protocol version only"
-            + EOLN + "  " + optionV12 + "              "
-            + "(default) Create stubs for 1.2 stub protocol version only"
-            + EOLN + "  " + optionVCompat + "           "
-            + "Create stubs/skeletons compatible with both v1.1 and v1.2"
-            + EOLN + EOLN + "  " + optionTarget + " <version>  "
-            + "Generate class files for the specified VM version"
-            + EOLN + EOLN + "  " + optionKeep + "              "
-            + "Do not delete generated source files" + EOLN + "  "
-            + optionKeepGenerated + "     (the same as \"" + optionKeep + "\")"
-            + EOLN + EOLN + "  " + optionDebug
-            + "                 Generate debug information" + EOLN + "  "
-            + optionNoWarnings + "            Do not notify about warnings"
-            + EOLN + "  " + optionNoWrite + "           "
-            + "Check run: do not write compiled classes" + EOLN + "  "
-            + optionVerbose + "           Print detailed compilation log"
-            + EOLN + EOLN + "  " + optionDestinationDir
-            + " <directory>         Target directory for generated files"
-            + EOLN + "  " + optionClassPath
-            + " <path>      Input class files location"
-            + EOLN + "  " + optionCP + " <path>             (the same as \""
-            + optionClassPath + "\")" + EOLN + "  " + optionBootClassPath
-            + " <path>  Override location of bootstrap class files"
-            + EOLN + "  " + optionExtDirs
-            + " <dirs>        Override location of installed extensions"
-            + EOLN + EOLN + "  " + optionJava
-            + "<JVM option>         Pass option to JVM"
-            + EOLN + "  " + optionX
-            + "<extended option>    Pass -X option to JVM";
+    
+    /* rmi.console.1C=Usage: rmic <options> <class names>
+     * rmi.console.1D=Options:
+     * rmi.console.1E=Create stubs/skeletons for 1.1 stub protocol version only
+     * rmi.console.1F=(default) Create stubs for 1.2 stub protocol version only
+     * rmi.console.20=Create stubs/skeletons compatible with both v1.1 and v1.2
+     * rmi.console.21=Generate class files for the specified VM version
+     * rmi.console.22=Do not delete generated source files
+     * rmi.console.23=\ \ \ \ \ (the same as "
+     * rmi.console.24=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Generate debug information
+     * rmi.console.25=\ \ \ \ \ \ \ \ \ \ \ \ Do not notify about warnings
+     * rmi.console.26=Check run: do not write compiled classes
+     * rmi.console.27=\ \ \ \ \ \ \ \ \ \ \ Print detailed compilation log
+     * rmi.console.28=\ <directory>         Target directory for generated files
+     * rmi.console.29=\ <path>      Input class files location
+     * rmi.console.2A=\ <path>             (the same as "
+     * rmi.console.2B=\ <path>  Override location of bootstrap class files
+     * rmi.console.2C=\ <dirs>        Override location of installed extensions
+     * rmi.console.2D=<JVM option>         Pass option to JVM
+     * rmi.console.2E=<extended option>    Pass -X option to JVM
+     */
+    String usageText = Messages.getString("rmi.console.1C") + EOLN //$NON-NLS-1$
+            + EOLN + Messages.getString("rmi.console.1D") + EOLN + "  " + optionV11 + "              " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+            + Messages.getString("rmi.console.1E") //$NON-NLS-1$
+            + EOLN + "  " + optionV12 + "              " //$NON-NLS-1$ //$NON-NLS-2$
+            + Messages.getString("rmi.console.1F") //$NON-NLS-1$
+            + EOLN + "  " + optionVCompat + "           " //$NON-NLS-1$ //$NON-NLS-2$
+            + Messages.getString("rmi.console.20") //$NON-NLS-1$
+            + EOLN + EOLN + "  " + optionTarget + " <version>  " //$NON-NLS-1$ //$NON-NLS-2$
+            + Messages.getString("rmi.console.21") //$NON-NLS-1$
+            + EOLN + EOLN + "  " + optionKeep + "              " //$NON-NLS-1$ //$NON-NLS-2$
+            + Messages.getString("rmi.console.22") + EOLN + "  " //$NON-NLS-1$ //$NON-NLS-2$
+            + optionKeepGenerated + Messages.getString("rmi.console.23") + optionKeep + "\")" //$NON-NLS-1$ //$NON-NLS-2$
+            + EOLN + EOLN + "  " + optionDebug //$NON-NLS-1$
+            + Messages.getString("rmi.console.24") + EOLN + "  " //$NON-NLS-1$ //$NON-NLS-2$
+            + optionNoWarnings + Messages.getString("rmi.console.25") //$NON-NLS-1$
+            + EOLN + "  " + optionNoWrite + "           " //$NON-NLS-1$ //$NON-NLS-2$
+            + Messages.getString("rmi.console.26") + EOLN + "  " //$NON-NLS-1$ //$NON-NLS-2$
+            + optionVerbose + Messages.getString("rmi.console.27") //$NON-NLS-1$
+            + EOLN + EOLN + "  " + optionDestinationDir //$NON-NLS-1$
+            + Messages.getString("rmi.console.28") //$NON-NLS-1$
+            + EOLN + "  " + optionClassPath //$NON-NLS-1$
+            + Messages.getString("rmi.console.29") //$NON-NLS-1$
+            + EOLN + "  " + optionCP + Messages.getString("rmi.console.2A") //$NON-NLS-1$ //$NON-NLS-2$
+            + optionClassPath + "\")" + EOLN + "  " + optionBootClassPath //$NON-NLS-1$ //$NON-NLS-2$
+            + Messages.getString("rmi.console.2B") //$NON-NLS-1$
+            + EOLN + "  " + optionExtDirs //$NON-NLS-1$
+            + Messages.getString("rmi.console.2C") //$NON-NLS-1$
+            + EOLN + EOLN + "  " + optionJava //$NON-NLS-1$
+            + Messages.getString("rmi.console.2D") //$NON-NLS-1$
+            + EOLN + "  " + optionX //$NON-NLS-1$
+            + Messages.getString("rmi.console.2E"); //$NON-NLS-1$
 
     /**
      * Version error text.
-     */
-    String errorVersionText = "You should specify at most one of \""
-            + optionV11 + "\", \"" + optionV12 + "\" (default), \""
-            + optionVCompat + "\", \"" + optionIDL + "\", \"" + optionIIOP;
+     */ 
+    /* rmi.console.2F=You should specify at most one of "
+     * rmi.console.31=" (default), "
+     */
+    String errorVersionText = Messages.getString("rmi.console.2F") //$NON-NLS-1$
+            + optionV11 + "\", \"" + optionV12 + Messages.getString("rmi.console.31") //$NON-NLS-1$ //$NON-NLS-2$
+            + optionVCompat + "\", \"" + optionIDL + "\", \"" + optionIIOP; //$NON-NLS-1$ //$NON-NLS-2$
 
     /**
      * No option parameter error text.
+     */ 
+    /*
+     rmi.console.32=Option %s requires a parameter
      */
-    String errorNeedParameterText = "Option %s requires a parameter";
+    String errorNeedParameterText = Messages.getString("rmi.console.32"); //$NON-NLS-1$
 
     /**
      * No JVM option parameter error text.
      */
-    String errorNeedJVMParameterText = "Option %s must be immediately "
-                                 + "(without a space) followed by a JVM option";
+    /*
+     * rmi.console.33=Option %s must be immediately (without a space) followed by a JVM option
+     */
+    String errorNeedJVMParameterText = Messages.getString("rmi.console.33"); //$NON-NLS-1$
 
     /**
      * Need two parameters error text.
-     */
-    String errorNeedTwoParametersText = "Option %s requires two parameters";
+     */ 
+     /*
+      * rmi.console.35=Option %s requires two parameters 
+      */ 
+    String errorNeedTwoParametersText = Messages.getString("rmi.console.35"); //$NON-NLS-1$
 
     /**
      * Unknown option error text.
      */
-    String errorUnknownOptionText = "Unknown option: %s";
+    /*
+     * rmi.console.36=Unknown option: %s
+     */
+    String errorUnknownOptionText = Messages.getString("rmi.console.36"); //$NON-NLS-1$
 
     /**
      * No classes to compile error text.
      */
-    String errorNoClassesText = "No classes to compile specified";
+    /*
+     * rmi.console.37=No classes to compile specified
+     */
+    String errorNoClassesText = Messages.getString("rmi.console.37"); //$NON-NLS-1$
 
     /**
      * Unusable IDL/IIOP option error text.
      */
-    String errorUnusableExceptIDL_IIOP = "Option %s must only be used with "
-                                         + optionIDL + " or " + optionIIOP;
+    /*
+     * rmi.console.38=Option %s must only be used with {0} or {1}
+     */
+    String errorUnusableExceptIDL_IIOP = Messages.getString("rmi.console.38", //$NON-NLS-1$
+                                         optionIDL, optionIIOP);
 
     /**
      * Unusable IDL option error text.
      */
-    String errorUnusableExceptIDL = "Option %s must only be used with "
-                                    + optionIDL;
+    /*
+     * rmi.console.39=Option %s must only be used with {0}
+     */
+    String errorUnusableExceptIDL = Messages.getString("rmi.console.39", //$NON-NLS-1$
+                                    optionIDL);
 
     /**
      * Unusable IIOP option error text.
      */
-    String errorUnusableExceptIIOP = "Option %s must only be used with "
-                                     + optionIIOP;
+    /*
+     * rmi.console.3A=Option %s must only be used with {0}
+     */
+    String errorUnusableExceptIIOP = Messages.getString("rmi.console.3A", //$NON-NLS-1$
+                                     optionIIOP);
 
     /**
      * Warning about classpath.
      */
-    String warningClassPathText = "%s is specified. For proper operation "
-            + "the same %s should be specified in VM arguments. "
-            + "This is a limitation of current RMIC implementation.";
+    /*
+     * rmi.console.3B=%s is specified. For proper operation the same %s + 
+     *                should be specified in VM arguments. This is a + 
+     *                limitation of current RMIC implementation.
+     */
+    String warningClassPathText = Messages.getString("rmi.console.3B"); //$NON-NLS-1$
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java Fri Oct  6 03:15:51 2006
@@ -25,6 +25,7 @@
 import java.io.File;
 
 import org.apache.harmony.rmi.common.RMIUtil;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -84,7 +85,7 @@
      */
     static String getObjectParameterString(Class cls, String varName) {
         return (cls.isPrimitive()
-                ? ("new " + RMIUtil.getWrappingClass(cls).getName()
+                ? ("new " + RMIUtil.getWrappingClass(cls).getName() //$NON-NLS-1$
                 + '(' + varName + ')') : varName);
     }
 
@@ -123,7 +124,7 @@
      */
     static String getHandlingType(Class cls) {
         return (cls.isPrimitive()
-                ? firstLetterToUpperCase(cls.getName()) : "Object");
+                ? firstLetterToUpperCase(cls.getName()) : "Object"); //$NON-NLS-1$
     }
 
     /**
@@ -150,8 +151,8 @@
         // For primitive types, use respective special read method.
         // For non-primitive types, use readObject() and cast (if not Object).
         return (((!cls.isPrimitive() && (cls != Object.class))
-                ? ('(' + RMIUtil.getCanonicalName(cls) + ") ") : "")
-                + streamName + ".read" + getHandlingType(cls) + "()");
+                ? ('(' + RMIUtil.getCanonicalName(cls) + ") ") : "") //$NON-NLS-1$ //$NON-NLS-2$
+                + streamName + ".read" + getHandlingType(cls) + "()"); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
     /**
@@ -178,7 +179,7 @@
             String streamName) {
         // For primitive types, use respective special write method.
         // For non-primitive types, use writeObject().
-        return (streamName + ".write" + getHandlingType(cls)
+        return (streamName + ".write" + getHandlingType(cls) //$NON-NLS-1$
                 + '(' + varName +')');
     }
 
@@ -208,13 +209,13 @@
         }
 
         // For all other types, create the respective cast statement.
-        StringBuffer buffer = new StringBuffer("((");
+        StringBuffer buffer = new StringBuffer("(("); //$NON-NLS-1$
         buffer.append(RMIUtil.getCanonicalName(RMIUtil.getWrappingClass(cls)));
-        buffer.append(") " + varName + ')');
+        buffer.append(") " + varName + ')'); //$NON-NLS-1$
 
         // For primitive types, include case to primitive type.
         if (cls.isPrimitive()) {
-            buffer.append('.' + cls.getName() + "Value()");
+            buffer.append('.' + cls.getName() + "Value()"); //$NON-NLS-1$
         }
 
         return buffer.toString();
@@ -238,11 +239,11 @@
      */
     static File getPackageDir(String base, String packageName)
             throws RMICompilerException {
-        File dir = new File(base, (packageName != null) ? packageName : "");
+        File dir = new File(base, (packageName != null) ? packageName : ""); //$NON-NLS-1$
 
         if (dir.exists() ? !dir.isDirectory() : !dir.mkdirs()) {
-            throw new RMICompilerException(
-                    "Can't create target directory: " + dir);
+            // rmi.4E=Can't create target directory: {0}
+            throw new RMICompilerException(Messages.getString("rmi.4E", dir)); //$NON-NLS-1$
         }
 
         return dir;
@@ -270,7 +271,8 @@
 
         if (file.exists()
                 ? !(file.isFile() && file.canWrite()) : !dir.canWrite()) {
-            throw new RMICompilerException("Can't create file: " + file);
+            // rmi.4F=Can't create file: {0}
+            throw new RMICompilerException(Messages.getString("rmi.4F", file)); //$NON-NLS-1$
         }
 
         return file;



Mime
View raw message