Repository: maven-surefire
Updated Branches:
  refs/heads/master 6fd0a3e7c -> f4f78c9f1


Fixed buid: Surefire34SecurityManagerIT


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/f4f78c9f
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/f4f78c9f
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/f4f78c9f

Branch: refs/heads/master
Commit: f4f78c9f155ad57fe75c8845eb4916481ae675ab
Parents: 6fd0a3e
Author: Tibor17 <tibo...@lycos.com>
Authored: Sat Apr 8 00:24:49 2017 +0200
Committer: Tibor17 <tibo...@lycos.com>
Committed: Sat Apr 8 00:24:49 2017 +0200

----------------------------------------------------------------------
 .../maven/surefire/booter/ForkedBooter.java     | 23 ++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/f4f78c9f/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
----------------------------------------------------------------------
diff --git 
a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
 
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
index a011594..3c18578 100644
--- 
a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
+++ 
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
@@ -34,6 +34,9 @@ import java.io.InputStream;
 import java.io.PrintStream;
 import java.lang.management.ManagementFactory;
 import java.lang.reflect.InvocationTargetException;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
@@ -170,11 +173,27 @@ public final class ForkedBooter
         }
     }
 
-    private static void cancelPingScheduler( ExecutorService pingScheduler )
+    private static void cancelPingScheduler( final ExecutorService 
pingScheduler )
     {
         if ( pingScheduler != null )
         {
-            pingScheduler.shutdown();
+            try
+            {
+                AccessController.doPrivileged( new PrivilegedAction<Object>()
+                                               {
+                                                   @Override
+                                                   public Object run()
+                                                   {
+                                                       
pingScheduler.shutdown();
+                                                       return null;
+                                                   }
+                                               }
+                );
+            }
+            catch ( AccessControlException e )
+            {
+                // ignore
+            }
         }
     }
 

Reply via email to