--- jsr166/src/test/tck/ExecutorsTest.java 2009/11/20 22:58:48 1.24 +++ jsr166/src/test/tck/ExecutorsTest.java 2009/11/21 02:07:26 1.25 @@ -304,21 +304,21 @@ public class ExecutorsTest extends JSR16 final ThreadGroup egroup = Thread.currentThread().getThreadGroup(); Runnable r = new Runnable() { public void run() { - try { - Thread current = Thread.currentThread(); - threadAssertTrue(!current.isDaemon()); - threadAssertTrue(current.getPriority() <= Thread.NORM_PRIORITY); - ThreadGroup g = current.getThreadGroup(); - SecurityManager s = System.getSecurityManager(); - if (s != null) - threadAssertTrue(g == s.getThreadGroup()); - else - threadAssertTrue(g == egroup); - String name = current.getName(); - threadAssertTrue(name.endsWith("thread-1")); - } catch (SecurityException ok) { - // Also pass if not allowed to change setting - } + try { + Thread current = Thread.currentThread(); + threadAssertTrue(!current.isDaemon()); + threadAssertTrue(current.getPriority() <= Thread.NORM_PRIORITY); + ThreadGroup g = current.getThreadGroup(); + SecurityManager s = System.getSecurityManager(); + if (s != null) + threadAssertTrue(g == s.getThreadGroup()); + else + threadAssertTrue(g == egroup); + String name = current.getName(); + threadAssertTrue(name.endsWith("thread-1")); + } catch (SecurityException ok) { + // Also pass if not allowed to change setting + } } }; ExecutorService e = Executors.newSingleThreadExecutor(Executors.defaultThreadFactory()); @@ -357,23 +357,23 @@ public class ExecutorsTest extends JSR16 final AccessControlContext thisacc = AccessController.getContext(); Runnable r = new Runnable() { public void run() { - try { - Thread current = Thread.currentThread(); - threadAssertTrue(!current.isDaemon()); - threadAssertTrue(current.getPriority() <= Thread.NORM_PRIORITY); - ThreadGroup g = current.getThreadGroup(); - SecurityManager s = System.getSecurityManager(); - if (s != null) - threadAssertTrue(g == s.getThreadGroup()); - else - threadAssertTrue(g == egroup); - String name = current.getName(); - threadAssertTrue(name.endsWith("thread-1")); - threadAssertTrue(thisccl == current.getContextClassLoader()); - threadAssertTrue(thisacc.equals(AccessController.getContext())); - } catch (SecurityException ok) { - // Also pass if not allowed to change settings - } + try { + Thread current = Thread.currentThread(); + threadAssertTrue(!current.isDaemon()); + threadAssertTrue(current.getPriority() <= Thread.NORM_PRIORITY); + ThreadGroup g = current.getThreadGroup(); + SecurityManager s = System.getSecurityManager(); + if (s != null) + threadAssertTrue(g == s.getThreadGroup()); + else + threadAssertTrue(g == egroup); + String name = current.getName(); + threadAssertTrue(name.endsWith("thread-1")); + threadAssertTrue(thisccl == current.getContextClassLoader()); + threadAssertTrue(thisacc.equals(AccessController.getContext())); + } catch (SecurityException ok) { + // Also pass if not allowed to change settings + } } }; ExecutorService e = Executors.newSingleThreadExecutor(Executors.privilegedThreadFactory()); @@ -413,7 +413,7 @@ public class ExecutorsTest extends JSR16 * privilegedCallableUsingCurrentClassLoader throws ACE */ public void testCreatePrivilegedCallableUsingCCLWithNoPrivs() { - Policy savedPolicy = null; + Policy savedPolicy = null; try { savedPolicy = Policy.getPolicy(); AdjustablePolicy policy = new AdjustablePolicy(); @@ -445,7 +445,7 @@ public class ExecutorsTest extends JSR16 * privilegedCallableUsingCurrentClassLoader does not throw ACE */ public void testprivilegedCallableUsingCCLWithPrivs() throws Exception { - Policy savedPolicy = null; + Policy savedPolicy = null; try { savedPolicy = Policy.getPolicy(); AdjustablePolicy policy = new AdjustablePolicy(); @@ -506,7 +506,7 @@ public class ExecutorsTest extends JSR16 * With permissions, calling privilegedCallable succeeds */ public void testprivilegedCallableWithPrivs() throws Exception { - Policy savedPolicy = null; + Policy savedPolicy = null; try { savedPolicy = Policy.getPolicy(); AdjustablePolicy policy = new AdjustablePolicy();