From f0f0f0c3458be58ac72a2843e93444418d269a1e Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Thu, 3 Oct 2024 07:26:52 -0700 Subject: [PATCH] Added some comments. --- src/main/java/org/cojen/dirmi/core/Item.java | 4 ++++ src/main/java/org/cojen/dirmi/core/Stub.java | 6 +++++- src/main/java/org/cojen/dirmi/core/StubMaker.java | 1 - 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cojen/dirmi/core/Item.java b/src/main/java/org/cojen/dirmi/core/Item.java index 9b1fa12f..0a8e18bd 100644 --- a/src/main/java/org/cojen/dirmi/core/Item.java +++ b/src/main/java/org/cojen/dirmi/core/Item.java @@ -23,6 +23,10 @@ * Base class for objects which are associated with an identifier. They can be stored within a * single ItemMap instance. * + *

This class is subclassed by Stub and so it must not declare any new public instance + * methods because they can conflict with user-specified remote methods which have the same + * signature. + * * @author Brian S O'Neill * @see ItemMap * @see IdGenerator diff --git a/src/main/java/org/cojen/dirmi/core/Stub.java b/src/main/java/org/cojen/dirmi/core/Stub.java index ebdecb59..52295598 100644 --- a/src/main/java/org/cojen/dirmi/core/Stub.java +++ b/src/main/java/org/cojen/dirmi/core/Stub.java @@ -23,7 +23,8 @@ import org.cojen.dirmi.Remote; /** - * Base class for remote stubs. + * Base class for remote stubs. It must not declare any new public instance methods because + * they can conflict with user-specified remote methods which have the same signature. * * @author Brian S O'Neill */ @@ -69,6 +70,9 @@ public Stub(long id, StubSupport support, MethodIdWriter miw) { /** * Returns true if this stub is restorable following a disconnect. * + * Note: This method must not be public or else it can conflict with a user-specified + * remote method which has the same signature. + * * @see #setRootOrigin */ final boolean isRestorable() { diff --git a/src/main/java/org/cojen/dirmi/core/StubMaker.java b/src/main/java/org/cojen/dirmi/core/StubMaker.java index be469430..b178e912 100644 --- a/src/main/java/org/cojen/dirmi/core/StubMaker.java +++ b/src/main/java/org/cojen/dirmi/core/StubMaker.java @@ -506,7 +506,6 @@ private void writeParams(MethodMaker mm, Variable pipeVar, writeName = "writeSyntheticMethodId"; } - mm.field("miw").getAcquire().invoke(writeName, pipeVar, methodId, method.name()); if (ptypes.length <= 0) {