Mercurial > hg > truffle
annotate test/runtime/RedefineObject/WalkThroughInvoke.java @ 18371:837e4c31f9d8
Make GraphMaker a static inner class to allow subclassing it independently from ReplacementsImpl
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Thu, 13 Nov 2014 14:30:15 -0800 |
parents | 85147f28faba |
children |
rev | line source |
---|---|
12022
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
1 /* |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
4 * |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
8 * |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
13 * accompanied this code). |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
14 * |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
18 * |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
21 * questions. |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
22 */ |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
23 import java.lang.reflect.*; |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
24 |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
25 public class WalkThroughInvoke { |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
26 public void stackWalk() { |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
27 try { |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
28 Class b = Object.class; |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
29 SecurityManager sm = new SecurityManager(); |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
30 // Walks the stack with Method.invoke in the stack (which is the |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
31 // purpose of the test) before it gets an AccessControlException. |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
32 sm.checkMemberAccess(b, Member.DECLARED); |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
33 } catch (java.security.AccessControlException e) { |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
34 // Ignoring an 'AccessControlException' exception since |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
35 // it is expected as part of this test. |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
36 } |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
37 } |
85147f28faba
8009728: nsk/jvmti/AttachOnDemand/attach030 crashes on Win32
coleenp
parents:
diff
changeset
|
38 }; |