summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAudrius Meskauskas <audriusa@Bioinformatics.org>2006-02-19 20:12:04 +0000
committerAudrius Meskauskas <audriusa@Bioinformatics.org>2006-02-19 20:12:04 +0000
commit89ff83e114c3744b1a3e99667988b3afc464b6ec (patch)
tree3a895613d1564ad52eb6040e390a4a0db169c34a
parent55ab949bb7d6c7bf62e64d7ad7dcb7d805882d74 (diff)
downloadclasspath-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.
-rw-r--r--ChangeLog11
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java18
-rw-r--r--tools/gnu/classpath/tools/rmi/RMIC.java2
-rw-r--r--tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java25
-rw-r--r--tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav4
5 files changed, 39 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 96cdf44e1..783692ede 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
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.
+
+2006-02-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
* java/rmi/server/UnicastRemoteObject.java: Documenting.
2006-02-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
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);
}