ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CompletableFutureTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.146 by jsr166, Mon Apr 11 06:31:42 2016 UTC vs.
Revision 1.147 by jsr166, Sat Jun 4 23:49:29 2016 UTC

# Line 3632 | Line 3632 | public class CompletableFutureTest exten
3632      //--- tests of implementation details; not part of official tck ---
3633  
3634      Object resultOf(CompletableFuture<?> f) {
3635 +        SecurityManager sm = System.getSecurityManager();
3636 +        if (sm != null) {
3637 +            try {
3638 +                System.setSecurityManager(null);
3639 +            } catch (SecurityException giveUp) {
3640 +                return "Reflection not available";
3641 +            }
3642 +        }
3643 +
3644          try {
3645              java.lang.reflect.Field resultField
3646                  = CompletableFuture.class.getDeclaredField("result");
3647              resultField.setAccessible(true);
3648              return resultField.get(f);
3649 <        } catch (Throwable t) { throw new AssertionError(t); }
3649 >        } catch (Throwable t) {
3650 >            throw new AssertionError(t);
3651 >        } finally {
3652 >            if (sm != null) System.setSecurityManager(sm);
3653 >        }
3654      }
3655  
3656      public void testExceptionPropagationReusesResultObject() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines