author | dholmes |
Sat, 23 Jun 2018 01:32:41 -0400 | |
changeset 50735 | 2f2af62dfac7 |
permissions | -rw-r--r-- |
50735
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
1 |
/* |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
4 |
* |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
8 |
* |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
13 |
* accompanied this code). |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
14 |
* |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
18 |
* |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
21 |
* questions. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
22 |
*/ |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
23 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
24 |
/* |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
25 |
* @test |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
26 |
* @bug 8046171 |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
27 |
* @summary Test access to private constructors between nestmates and nest-host |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
28 |
* using different flavours of named nested types using MethodHandles |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
29 |
* @run main TestMethodHandles |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
30 |
*/ |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
31 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
32 |
import java.lang.invoke.*; |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
33 |
import static java.lang.invoke.MethodHandles.*; |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
34 |
import static java.lang.invoke.MethodType.*; |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
35 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
36 |
public class TestMethodHandles { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
37 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
38 |
static final MethodType NOARG_T = MethodType.methodType(void.class); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
39 |
static final MethodType INNER_T = MethodType.methodType(void.class, TestMethodHandles.class); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
40 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
41 |
// All constructors are private to ensure nestmate access checks apply |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
42 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
43 |
// All doConstruct methods are public so they don't involve invoke_special |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
44 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
45 |
private TestMethodHandles() {} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
46 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
47 |
// The various nestmates |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
48 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
49 |
// Note: No constructor on interfaces so no StaticIface variants |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
50 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
51 |
static interface StaticIface { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
52 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
53 |
// Methods that will access private constructors of nestmates. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
54 |
// The arg is a dummy for overloading purposes |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
55 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
56 |
default void doConstruct(TestMethodHandles o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
57 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
58 |
lookup().findConstructor(TestMethodHandles.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
59 |
TestMethodHandles obj = (TestMethodHandles) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
60 |
obj = (TestMethodHandles) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
61 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
62 |
default void doConstruct(TestMethodHandles outer, InnerNested o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
63 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
64 |
lookup().findConstructor(InnerNested.class, INNER_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
65 |
InnerNested obj = (InnerNested) mh.invoke(outer); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
66 |
obj = (InnerNested) mh.invokeExact(outer); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
67 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
68 |
default void doConstruct(StaticNested o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
69 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
70 |
lookup().findConstructor(StaticNested.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
71 |
StaticNested obj = (StaticNested) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
72 |
obj = (StaticNested) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
73 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
74 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
75 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
76 |
static class StaticNested { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
77 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
78 |
private StaticNested() {} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
79 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
80 |
// Methods that will access private constructors of nestmates. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
81 |
// The arg is a dummy for overloading purposes |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
82 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
83 |
public void doConstruct(TestMethodHandles o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
84 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
85 |
lookup().findConstructor(TestMethodHandles.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
86 |
TestMethodHandles obj = (TestMethodHandles) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
87 |
obj = (TestMethodHandles) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
88 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
89 |
public void doConstruct(TestMethodHandles outer, InnerNested o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
90 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
91 |
lookup().findConstructor(InnerNested.class, INNER_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
92 |
InnerNested obj = (InnerNested) mh.invoke(outer); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
93 |
obj = (InnerNested) mh.invokeExact(outer); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
94 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
95 |
public void doConstruct(StaticNested o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
96 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
97 |
lookup().findConstructor(StaticNested.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
98 |
StaticNested obj = (StaticNested) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
99 |
obj = (StaticNested) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
100 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
101 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
102 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
103 |
class InnerNested { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
104 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
105 |
private InnerNested() {} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
106 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
107 |
// Methods that will access private constructors of nestmates. |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
108 |
// The arg is a dummy for overloading purposes |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
109 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
110 |
public void doConstruct(TestMethodHandles o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
111 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
112 |
lookup().findConstructor(TestMethodHandles.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
113 |
TestMethodHandles obj = (TestMethodHandles) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
114 |
obj = (TestMethodHandles) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
115 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
116 |
public void doConstruct(TestMethodHandles outer, InnerNested o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
117 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
118 |
lookup().findConstructor(InnerNested.class, INNER_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
119 |
InnerNested obj = (InnerNested) mh.invoke(outer); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
120 |
obj = (InnerNested) mh.invokeExact(outer); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
121 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
122 |
public void doConstruct(StaticNested o) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
123 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
124 |
lookup().findConstructor(StaticNested.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
125 |
StaticNested obj = (StaticNested) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
126 |
obj = (StaticNested) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
127 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
128 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
129 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
130 |
public static void main(String[] args) throws Throwable { |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
131 |
// These initial constructions test nest-host access |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
132 |
MethodHandle mh = |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
133 |
lookup().findConstructor(TestMethodHandles.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
134 |
TestMethodHandles o = (TestMethodHandles) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
135 |
o = (TestMethodHandles) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
136 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
137 |
mh = lookup().findConstructor(StaticNested.class, NOARG_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
138 |
StaticNested s = (StaticNested) mh.invoke(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
139 |
s = (StaticNested) mh.invokeExact(); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
140 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
141 |
mh = lookup().findConstructor(InnerNested.class, INNER_T); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
142 |
InnerNested i = (InnerNested) mh.invoke(o); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
143 |
i = (InnerNested) mh.invokeExact(o); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
144 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
145 |
StaticIface intf = new StaticIface() {}; |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
146 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
147 |
s.doConstruct(o); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
148 |
s.doConstruct(o, i); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
149 |
s.doConstruct(s); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
150 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
151 |
i.doConstruct(o); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
152 |
i.doConstruct(o, i); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
153 |
i.doConstruct(s); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
154 |
|
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
155 |
intf.doConstruct(o); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
156 |
intf.doConstruct(o, i); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
157 |
intf.doConstruct(s); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
158 |
} |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
diff
changeset
|
159 |
} |