diff options
author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-02-19 20:12:04 +0000 |
---|---|---|
committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-02-19 20:12:04 +0000 |
commit | 89ff83e114c3744b1a3e99667988b3afc464b6ec (patch) | |
tree | 3a895613d1564ad52eb6040e390a4a0db169c34a /tools/gnu/classpath/tools/rmi | |
parent | 55ab949bb7d6c7bf62e64d7ad7dcb7d805882d74 (diff) | |
download | classpath-89ff83e114c3744b1a3e99667988b3afc464b6ec.tar.gz |
2006-02-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* 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.
Diffstat (limited to 'tools/gnu/classpath/tools/rmi')
-rw-r--r-- | tools/gnu/classpath/tools/rmi/RMIC.java | 2 | ||||
-rw-r--r-- | tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java | 25 | ||||
-rw-r--r-- | tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav | 4 |
3 files changed, 14 insertions, 17 deletions
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); } |