From a09f06d538075bcdd7cce6da9c3bf9549ce7d543 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Fri, 24 Jan 2025 08:39:37 +0000 Subject: [PATCH] 8348265: RMIConnectionImpl: Remove Subject.callAs on MarshalledObject Reviewed-by: rriggs --- .../remote/rmi/RMIConnectionImpl.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java index 36fe54ecc66..5526f7a0f90 100644 --- a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java +++ b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java @@ -122,7 +122,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { } public String getConnectionId() throws IOException { - // We should call reqIncomming() here... shouldn't we? + // reqIncoming()/rspOutgoing() could be here, but never have been. return connectionId; } @@ -1495,20 +1495,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { try { ClassLoader old = setCcl(cl); try { - if (subject != null) { - try { - return Subject.callAs(subject, () -> wrappedClass.cast(mo.get())); - } catch (CompletionException ce) { - Throwable thr = ce.getCause(); - if (thr instanceof Exception e) { - throw e; - } else { - throw new RuntimeException(thr); - } - } - } else { - return wrappedClass.cast(mo.get()); - } + return wrappedClass.cast(mo.get()); } finally { setCcl(old); }