diff options
Diffstat (limited to 'tools/gnu/classpath')
4 files changed, 28 insertions, 21 deletions
diff --git a/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java b/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java index 0bbbc7a90..c19f635c6 100644 --- a/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java +++ b/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java @@ -154,10 +154,8 @@ public class GiopRmicCompiler 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 @@ public class GiopRmicCompiler { 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; + } } diff --git a/tools/gnu/classpath/tools/rmi/RMIC.java b/tools/gnu/classpath/tools/rmi/RMIC.java index e16e08507..09021dd3f 100644 --- a/tools/gnu/classpath/tools/rmi/RMIC.java +++ b/tools/gnu/classpath/tools/rmi/RMIC.java @@ -163,7 +163,7 @@ public class RMIC // Generate stub. String stub = compiler.generateStub(); - String subName = "_" + compiler.getStubName() + "_Stub.java"; + String subName = compiler.getStubName() + "_Stub.java"; if (noWrite) continue Compile; diff --git a/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java b/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java index 209d1cca4..9b7f9358b 100644 --- a/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java +++ b/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java @@ -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 class RmiMethodGenerator */ 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; + } + } diff --git a/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav b/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav index 7ed27d19d..58d5f3c3e 100644 --- a/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav +++ b/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav @@ -12,7 +12,7 @@ import java.rmi.UnexpectedException; * * It is normally generated with rmic. */ -public final class _#name_Stub +public final class #name_Stub extends RemoteStub implements #interfaces { @@ -52,7 +52,7 @@ public final class _#name_Stub * * @para the reference to the remote object. */ - public _#name_Stub(RemoteRef reference) + public #name_Stub(RemoteRef reference) { super(reference); } |