Skip to content

Commit 4cf6a05

Browse files
committed
refactor(rmi): remove ClientUtil and simplify stub creation
Remove the ClientUtil utility class that was used to check if running as a client container. This check is no longer needed, so the stub creation logic in PortableRemoteObjectImpl has been simplified to directly call state.createRMIStub(type). Changes: - Removed ClientUtil.java - Removed ClientUtil import from PortableRemoteObjectImpl - Simplified createStub() method to remove Optional filter chain Co-authored-by-AI: IBM Bob 2.0.0
1 parent a858e9c commit 4cf6a05

2 files changed

Lines changed: 1 addition & 35 deletions

File tree

yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/PortableRemoteObjectImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
package org.apache.yoko.rmi.impl;
1919

20-
import org.apache.yoko.rmi.util.ClientUtil;
2120
import org.omg.CORBA.BAD_INV_ORDER;
2221
import org.omg.CORBA.BAD_OPERATION;
2322
import org.omg.CORBA.portable.Delegate;
@@ -180,10 +179,7 @@ private static Stub createStub(Class<?> type) {
180179
if (Remote.class == type) return new RMIRemoteStub();
181180

182181
RMIState state = RMIState.current();
183-
return Optional.of(state)
184-
.filter(s -> ClientUtil.isRunningAsClientContainer())
185-
.map(s -> s.getStaticStub(null, type))
186-
.orElseGet(() -> state.createRMIStub(type));
182+
return state.createRMIStub(type);
187183
}
188184

189185
public Remote toStub(Remote value) throws NoSuchObjectException {

yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/util/ClientUtil.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)