changeset 10428:d8160158201b

8062807: Exporting RMI objects fails when run under restrictive SecurityManager Reviewed-by: dfuchs, skoivu, igerasim, msheppar
author smarks
date Thu, 06 Nov 2014 14:28:56 -0800
parents 2a6a6af6ca2a
children 291505d802d9
files src/share/classes/sun/rmi/transport/tcp/TCPTransport.java
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Wed Nov 12 13:02:00 2014 +0300
+++ b/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Thu Nov 06 14:28:56 2014 -0800
@@ -673,19 +673,19 @@
         }
 
         public void run() {
-            AccessController.doPrivileged((PrivilegedAction<Void>)() -> {
-                    Thread t = Thread.currentThread();
-                    String name = t.getName();
-                    try {
-                        t.setName("RMI TCP Connection(" +
-                                  connectionCount.incrementAndGet() +
-                                  ")-" + remoteHost);
-                        run0();
-                    } finally {
-                        t.setName(name);
-                    }
+            Thread t = Thread.currentThread();
+            String name = t.getName();
+            try {
+                t.setName("RMI TCP Connection(" +
+                          connectionCount.incrementAndGet() +
+                          ")-" + remoteHost);
+                AccessController.doPrivileged((PrivilegedAction<Void>)() -> {
+                    run0();
                     return null;
                 }, NOPERMS_ACC);
+            } finally {
+                t.setName(name);
+            }
         }
 
         private void run0() {