2006-02-19  Audrius Meskauskas  <[EMAIL PROTECTED]>

   * gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java (compile):
   Call convertStubName. (convertStubName): New method.
   * gnu/classpath/tools/rmi/RMIC.java (main): Stub name fix.
* gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java (convertStubName): New method. (getMethodHashCode): Use existing gnu.java.rmi.server.RMIHashes.getMethodHash.
   * gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav: Stub name fix.
Index: gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java
===================================================================
RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java,v
retrieving revision 1.3
diff -u -r1.3 GiopRmicCompiler.java
--- gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java	11 Feb 2006 20:41:56 -0000	1.3
+++ gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java	19 Feb 2006 20:04:27 -0000
@@ -154,10 +154,8 @@
         packag = s.substring(0, p);
         implName = name = s.substring(p + 1);
       }
-
-    // Drop the Impl suffix, if one exists.
-    if (name.endsWith("Impl"))
-      name = name.substring(0, name.length() - "Impl".length());
+     
+    name = convertStubName(name);
 
     stubName = name;
 
@@ -501,4 +499,16 @@
   {
     return stubName;
   }
+  
+  /**
+   * Additional processing of the stub name.
+   */
+  public String convertStubName(String name)
+  {
+    // Drop the Impl suffix, if one exists.
+    if (name.endsWith("Impl"))
+      return name.substring(0, name.length() - "Impl".length());
+    else
+      return name;
+  }
 }
Index: gnu/classpath/tools/rmi/RMIC.java
===================================================================
RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/rmi/RMIC.java,v
retrieving revision 1.1
diff -u -r1.1 RMIC.java
--- gnu/classpath/tools/rmi/RMIC.java	9 Feb 2006 20:22:07 -0000	1.1
+++ gnu/classpath/tools/rmi/RMIC.java	19 Feb 2006 20:04:27 -0000
@@ -163,7 +163,7 @@
 
                 // Generate stub.
                 String stub = compiler.generateStub();
-                String subName = "_" + compiler.getStubName() + "_Stub.java";
+                String subName = compiler.getStubName() + "_Stub.java";
 
                 if (noWrite)
                   continue Compile;
Index: gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java
===================================================================
RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java,v
retrieving revision 1.1
diff -u -r1.1 RmiMethodGenerator.java
--- gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java	9 Feb 2006 20:22:07 -0000	1.1
+++ gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java	19 Feb 2006 20:04:28 -0000
@@ -39,6 +39,7 @@
 package gnu.classpath.tools.rmi.rmic;
 
 import gnu.classpath.tools.AbstractMethodGenerator;
+import gnu.java.rmi.server.RMIHashes;
 
 import java.lang.reflect.Method;
 import java.util.Properties;
@@ -284,19 +285,15 @@
    */
   public String getMethodHashCode()
   {
-    // Using the reliable chechsum method as this is a code generator, as
-    // the code will be generated once, but is likely to be used much more
-    // frequently.
-    Adler32 adler = new Adler32();
-
-    adler.update(method.getDeclaringClass().getName().getBytes());
-    adler.update(method.getName().getBytes());
-
-    Class[] args = method.getParameterTypes();
-    for (int i = 0; i < args.length; i++)
-      {
-        adler.update(args[i].getName().getBytes());
-      }
-    return adler.getValue() + "L";
+    return RMIHashes.getMethodHash(method)+"L";
   }
+  
+  /**
+   * Additional processing of the stub name (nothing to do for JRMP stubs).
+   */
+  public String convertStubName(String name)
+  {
+    return name;
+  }
+  
 }
Index: gnu/classpath/tools/rmi/rmic/RmicCompiler.java
===================================================================
RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/rmi/rmic/RmicCompiler.java,v
retrieving revision 1.1
diff -u -r1.1 RmicCompiler.java
--- gnu/classpath/tools/rmi/rmic/RmicCompiler.java	9 Feb 2006 20:22:07 -0000	1.1
+++ gnu/classpath/tools/rmi/rmic/RmicCompiler.java	19 Feb 2006 20:04:29 -0000
@@ -171,5 +171,5 @@
     addZeroSizeObjecArray = false;
     super.reset();
   }
-  
+ 
 }
Index: gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav
===================================================================
RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav,v
retrieving revision 1.1
diff -u -r1.1 Stub_12.jav
--- gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav	9 Feb 2006 20:22:07 -0000	1.1
+++ gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav	19 Feb 2006 20:04:29 -0000
@@ -12,7 +12,7 @@
  *
  * It is normally generated with rmic.
  */
-public final class _#name_Stub 
+public final class #name_Stub 
     extends RemoteStub
     implements #interfaces
 {
@@ -52,7 +52,7 @@
      *
      * @para the reference to the remote object.
      */
-    public _#name_Stub(RemoteRef reference) 
+    public #name_Stub(RemoteRef reference) 
     {
        super(reference);
     }    

Reply via email to