changeset 11291:67ff22235717

8062807: Exporting RMI objects fails when run under restrictive SecurityManager Reviewed-by: dfuchs, skoivu, igerasim, msheppar
author smarks
date Tue, 18 Nov 2014 17:02:50 -0800
parents af3fd3c7e35c
children fffa3bec3e96 23f11e76a0ca
files src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Wed Nov 05 12:46:39 2014 +0400
+++ b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Tue Nov 18 17:02:50 2014 -0800
@@ -668,19 +668,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() {