Skip to content

Commit

Permalink
Fix handling of root stub reconnect when declared as AutoDispose.
Browse files Browse the repository at this point in the history
  • Loading branch information
broneill committed Feb 1, 2025
1 parent d1c9d30 commit f52e12c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/cojen/dirmi/core/ClientSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private boolean reconnectAttempt(Object result) {

mEngine.changeIdentity(this, newSession.id);

var newRoot = (StubInvoker) newSession.mRoot;
var newRoot = ((Stub) newSession.mRoot).invoker();
Object removed = newSession.mStubs.remove(newRoot);
assert newRoot == removed;
assert newSession.mStubs.size() == 0;
Expand All @@ -176,7 +176,7 @@ private boolean reconnectAttempt(Object result) {

cServerSessionIdHandle.setRelease(this, newSession.mServerSessionId);

var root = (StubInvoker) mRoot;
var root = ((Stub) mRoot).invoker();
mStubs.changeIdentity(root, newRoot.id);

Map<String, RemoteInfo> typeMap;
Expand Down Expand Up @@ -219,7 +219,7 @@ private boolean reconnectAttempt(Object result) {
return false;
}

StubInvoker.cSupportHandle.setRelease(mRoot, newSupport);
StubInvoker.cSupportHandle.setRelease(root, newSupport);

// For all restorable stubs, update the MethodIdWriter and set a support object that
// allows them to restore on demand.
Expand Down

0 comments on commit f52e12c

Please sign in to comment.