test/hotspot/jtreg/runtime/RedefineObject/WalkThroughInvoke.java
changeset 49520 7a64b48586d8
parent 47216 71c04702a3d5
equal deleted inserted replaced
49519:94129cb29710 49520:7a64b48586d8
     1 /*
     1 /*
     2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    27       try {
    27       try {
    28           Class b = Object.class;
    28           Class b = Object.class;
    29           SecurityManager sm = new SecurityManager();
    29           SecurityManager sm = new SecurityManager();
    30           // Walks the stack with Method.invoke in the stack (which is the
    30           // Walks the stack with Method.invoke in the stack (which is the
    31           // purpose of the test) before it gets an AccessControlException.
    31           // purpose of the test) before it gets an AccessControlException.
    32           sm.checkMemberAccess(b, Member.DECLARED);
    32           sm.checkPermission(new RuntimePermission("accessDeclaredMembers"));
    33       } catch (java.security.AccessControlException e) {
    33       } catch (java.security.AccessControlException e) {
    34           // Ignoring an 'AccessControlException' exception since
    34           // Ignoring an 'AccessControlException' exception since
    35           // it is expected as part of this test.
    35           // it is expected as part of this test.
    36       }
    36       }
    37   }
    37   }