author | alanb |
Fri, 16 Dec 2016 06:19:16 +0000 | |
changeset 42703 | 20c39ea4a507 |
parent 42338 | a60f280f803c |
child 43712 | 5dfd0950317c |
permissions | -rw-r--r-- |
2 | 1 |
/* |
36511 | 2 |
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.lang.reflect; |
|
27 |
||
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
28 |
import java.lang.annotation.Annotation; |
2 | 29 |
import java.security.AccessController; |
36511 | 30 |
|
42703
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
31 |
import jdk.internal.misc.VM; |
37363
329dba26ffd2
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
36511
diff
changeset
|
32 |
import jdk.internal.reflect.CallerSensitive; |
329dba26ffd2
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
36511
diff
changeset
|
33 |
import jdk.internal.reflect.Reflection; |
329dba26ffd2
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
36511
diff
changeset
|
34 |
import jdk.internal.reflect.ReflectionFactory; |
42703
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
35 |
import sun.security.action.GetPropertyAction; |
2 | 36 |
|
37 |
/** |
|
38 |
* The AccessibleObject class is the base class for Field, Method and |
|
39 |
* Constructor objects. It provides the ability to flag a reflected |
|
40 |
* object as suppressing default Java language access control checks |
|
36511 | 41 |
* when it is used. The access checks -- <em>module boundaries</em>, |
42 |
* public, default (package) access, protected, and private members -- |
|
43 |
* are performed when Fields, Methods or Constructors are used to set |
|
44 |
* or get fields, to invoke methods or to create and initialize new |
|
45 |
* instances of classes, respectively. Unlike access control specified |
|
46 |
* in the <cite>The Java™ Language Specification</cite> and |
|
47 |
* <cite>The Java Virtual Machine Specification</cite>, access checks |
|
48 |
* with reflected objects assume {@link Module#canRead readability}. |
|
2 | 49 |
* |
50 |
* <p>Setting the {@code accessible} flag in a reflected object |
|
51 |
* permits sophisticated applications with sufficient privilege, such |
|
52 |
* as Java Object Serialization or other persistence mechanisms, to |
|
53 |
* manipulate objects in a manner that would normally be prohibited. |
|
54 |
* |
|
4042
6fc4d5c2a456
6648344: (reflect spec) State default of isAccessible for reflective objects
darcy
parents:
3959
diff
changeset
|
55 |
* <p>By default, a reflected object is <em>not</em> accessible. |
6fc4d5c2a456
6648344: (reflect spec) State default of isAccessible for reflective objects
darcy
parents:
3959
diff
changeset
|
56 |
* |
2 | 57 |
* @see Field |
58 |
* @see Method |
|
59 |
* @see Constructor |
|
60 |
* @see ReflectPermission |
|
61 |
* |
|
62 |
* @since 1.2 |
|
63 |
*/ |
|
64 |
public class AccessibleObject implements AnnotatedElement { |
|
65 |
||
66 |
/** |
|
67 |
* The Permission object that is used to check whether a client |
|
68 |
* has sufficient privilege to defeat Java language access |
|
69 |
* control checks. |
|
70 |
*/ |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
27783
diff
changeset
|
71 |
private static final java.security.Permission ACCESS_PERMISSION = |
2 | 72 |
new ReflectPermission("suppressAccessChecks"); |
73 |
||
36511 | 74 |
static void checkPermission() { |
75 |
SecurityManager sm = System.getSecurityManager(); |
|
76 |
if (sm != null) sm.checkPermission(ACCESS_PERMISSION); |
|
77 |
} |
|
78 |
||
2 | 79 |
/** |
80 |
* Convenience method to set the {@code accessible} flag for an |
|
81 |
* array of objects with a single security check (for efficiency). |
|
82 |
* |
|
36511 | 83 |
* <p>This method cannot be used to enable access to an object that is a |
84 |
* {@link Member member} of a class in a different module to the caller and |
|
85 |
* where the class is in a package that is not exported to the caller's |
|
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
86 |
* module. Additionally, if the member is non-public or its declaring |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
87 |
* class is non-public, then this method can only be used to enable access |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
88 |
* if the package is {@link Module#isOpen(String,Module) open} to at least |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
89 |
* the caller's module. |
36511 | 90 |
* |
91 |
* <p>If there is a security manager, its |
|
92 |
* {@code checkPermission} method is first called with a |
|
2 | 93 |
* {@code ReflectPermission("suppressAccessChecks")} permission. |
94 |
* |
|
36511 | 95 |
* <p>A {@code SecurityException} is also thrown if any of the elements of |
96 |
* the input {@code array} is a {@link java.lang.reflect.Constructor} |
|
97 |
* object for the class {@code java.lang.Class} and {@code flag} is true. |
|
2 | 98 |
* |
99 |
* @param array the array of AccessibleObjects |
|
100 |
* @param flag the new value for the {@code accessible} flag |
|
101 |
* in each object |
|
36511 | 102 |
* @throws InaccessibleObjectException if access cannot be enabled |
2 | 103 |
* @throws SecurityException if the request is denied. |
104 |
* @see SecurityManager#checkPermission |
|
36511 | 105 |
* @see ReflectPermission |
2 | 106 |
*/ |
36511 | 107 |
@CallerSensitive |
108 |
public static void setAccessible(AccessibleObject[] array, boolean flag) { |
|
109 |
checkPermission(); |
|
110 |
if (flag) { |
|
111 |
Class<?> caller = Reflection.getCallerClass(); |
|
112 |
array = array.clone(); |
|
113 |
for (AccessibleObject ao : array) { |
|
114 |
ao.checkCanSetAccessible(caller); |
|
115 |
} |
|
116 |
} |
|
22581
e868cde95050
8032779: Update code in java.lang to use newer language features
psandoz
parents:
16051
diff
changeset
|
117 |
for (AccessibleObject ao : array) { |
36511 | 118 |
ao.setAccessible0(flag); |
2 | 119 |
} |
120 |
} |
|
121 |
||
122 |
/** |
|
123 |
* Set the {@code accessible} flag for this object to |
|
124 |
* the indicated boolean value. A value of {@code true} indicates that |
|
125 |
* the reflected object should suppress Java language access |
|
126 |
* checking when it is used. A value of {@code false} indicates |
|
36511 | 127 |
* that the reflected object should enforce Java language access checks |
128 |
* while assuming readability (as noted in the class description). |
|
2 | 129 |
* |
36511 | 130 |
* <p>This method cannot be used to enable access to an object that is a |
131 |
* {@link Member member} of a class in a different module to the caller and |
|
132 |
* where the class is in a package that is not exported to the caller's |
|
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
133 |
* module. Additionally, if the member is non-public or its declaring |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
134 |
* class is non-public, then this method can only be used to enable access |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
135 |
* if the package is {@link Module#isOpen(String,Module) open} to at least |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
136 |
* the caller's module. |
2 | 137 |
* |
36511 | 138 |
* <p>If there is a security manager, its |
139 |
* {@code checkPermission} method is first called with a |
|
140 |
* {@code ReflectPermission("suppressAccessChecks")} permission. |
|
2 | 141 |
* |
142 |
* @param flag the new value for the {@code accessible} flag |
|
36511 | 143 |
* @throws InaccessibleObjectException if access cannot be enabled |
144 |
* @throws SecurityException if the request is denied |
|
2 | 145 |
* @see SecurityManager#checkPermission |
36511 | 146 |
* @see ReflectPermission |
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
147 |
* @see java.lang.invoke.MethodHandles#privateLookupIn |
2 | 148 |
*/ |
36511 | 149 |
public void setAccessible(boolean flag) { |
150 |
AccessibleObject.checkPermission(); |
|
151 |
setAccessible0(flag); |
|
152 |
} |
|
153 |
||
154 |
void setAccessible0(boolean flag) { |
|
155 |
this.override = flag; |
|
156 |
} |
|
157 |
||
158 |
/** |
|
159 |
* If the given AccessibleObject is a {@code Constructor}, {@code Method} |
|
160 |
* or {@code Field} then checks that its declaring class is in a package |
|
161 |
* that can be accessed by the given caller of setAccessible. |
|
162 |
*/ |
|
163 |
void checkCanSetAccessible(Class<?> caller) { |
|
164 |
// do nothing, needs to be overridden by Constructor, Method, Field |
|
2 | 165 |
} |
166 |
||
36511 | 167 |
void checkCanSetAccessible(Class<?> caller, Class<?> declaringClass) { |
168 |
Module callerModule = caller.getModule(); |
|
169 |
Module declaringModule = declaringClass.getModule(); |
|
170 |
||
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
171 |
if (callerModule == declaringModule) return; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
172 |
if (callerModule == Object.class.getModule()) return; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
173 |
if (!declaringModule.isNamed()) return; |
36511 | 174 |
|
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
175 |
// package is open to caller |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
176 |
String pn = packageName(declaringClass); |
42703
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
177 |
if (declaringModule.isOpen(pn, callerModule)) { |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
178 |
printStackTraceIfOpenedReflectively(declaringModule, pn, callerModule); |
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
179 |
return; |
42703
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
180 |
} |
36511 | 181 |
|
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
182 |
// package is exported to caller and class/member is public |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
183 |
boolean isExported = declaringModule.isExported(pn, callerModule); |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
184 |
boolean isClassPublic = Modifier.isPublic(declaringClass.getModifiers()); |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
185 |
int modifiers; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
186 |
if (this instanceof Executable) { |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
187 |
modifiers = ((Executable) this).getModifiers(); |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
188 |
} else { |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
189 |
modifiers = ((Field) this).getModifiers(); |
2 | 190 |
} |
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
191 |
boolean isMemberPublic = Modifier.isPublic(modifiers); |
42703
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
192 |
if (isExported && isClassPublic && isMemberPublic) { |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
193 |
printStackTraceIfExportedReflectively(declaringModule, pn, callerModule); |
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
194 |
return; |
42703
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
195 |
} |
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
196 |
|
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
197 |
// not accessible |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
198 |
String msg = "Unable to make "; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
199 |
if (this instanceof Field) |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
200 |
msg += "field "; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
201 |
msg += this + " accessible: " + declaringModule + " does not \""; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
202 |
if (isClassPublic && isMemberPublic) |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
203 |
msg += "exports"; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
204 |
else |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
205 |
msg += "opens"; |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41560
diff
changeset
|
206 |
msg += " " + pn + "\" to " + callerModule; |
42703
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
207 |
InaccessibleObjectException e = new InaccessibleObjectException(msg); |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
208 |
if (Reflection.printStackTraceWhenAccessFails()) { |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
209 |
e.printStackTrace(System.err); |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
210 |
} |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
211 |
throw e; |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
212 |
} |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
213 |
|
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
214 |
private void printStackTraceIfOpenedReflectively(Module module, |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
215 |
String pn, |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
216 |
Module other) { |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
217 |
printStackTraceIfExposedReflectively(module, pn, other, true); |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
218 |
} |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
219 |
|
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
220 |
private void printStackTraceIfExportedReflectively(Module module, |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
221 |
String pn, |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
222 |
Module other) { |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
223 |
printStackTraceIfExposedReflectively(module, pn, other, false); |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
224 |
} |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
225 |
|
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
226 |
private void printStackTraceIfExposedReflectively(Module module, |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
227 |
String pn, |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
228 |
Module other, |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
229 |
boolean open) |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
230 |
{ |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
231 |
if (Reflection.printStackTraceWhenAccessSucceeds() |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
232 |
&& !module.isStaticallyExportedOrOpen(pn, other, open)) |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
233 |
{ |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
234 |
String msg = other + " allowed to invoke setAccessible on "; |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
235 |
if (this instanceof Field) |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
236 |
msg += "field "; |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
237 |
msg += this; |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
238 |
new Exception(msg) { |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
239 |
private static final long serialVersionUID = 42L; |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
240 |
public String toString() { |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
241 |
return "WARNING: " + getMessage(); |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
242 |
} |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
243 |
}.printStackTrace(System.err); |
20c39ea4a507
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42338
diff
changeset
|
244 |
} |
36511 | 245 |
} |
246 |
||
247 |
/** |
|
248 |
* Returns the package name of the given class. |
|
249 |
*/ |
|
250 |
private static String packageName(Class<?> c) { |
|
251 |
while (c.isArray()) { |
|
252 |
c = c.getComponentType(); |
|
253 |
} |
|
254 |
String pn = c.getPackageName(); |
|
255 |
return (pn != null) ? pn : ""; |
|
2 | 256 |
} |
257 |
||
258 |
/** |
|
259 |
* Get the value of the {@code accessible} flag for this object. |
|
260 |
* |
|
261 |
* @return the value of the object's {@code accessible} flag |
|
262 |
*/ |
|
263 |
public boolean isAccessible() { |
|
264 |
return override; |
|
265 |
} |
|
266 |
||
267 |
/** |
|
268 |
* Constructor: only used by the Java Virtual Machine. |
|
269 |
*/ |
|
270 |
protected AccessibleObject() {} |
|
271 |
||
272 |
// Indicates whether language-level access checks are overridden |
|
273 |
// by this object. Initializes to "false". This field is used by |
|
274 |
// Field, Method, and Constructor. |
|
275 |
// |
|
276 |
// NOTE: for security purposes, this field must not be visible |
|
277 |
// outside this package. |
|
278 |
boolean override; |
|
279 |
||
280 |
// Reflection factory used by subclasses for creating field, |
|
281 |
// method, and constructor accessors. Note that this is called |
|
282 |
// very early in the bootstrapping process. |
|
51 | 283 |
static final ReflectionFactory reflectionFactory = |
284 |
AccessController.doPrivileged( |
|
37363
329dba26ffd2
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
36511
diff
changeset
|
285 |
new ReflectionFactory.GetReflectionFactoryAction()); |
2 | 286 |
|
287 |
/** |
|
288 |
* @throws NullPointerException {@inheritDoc} |
|
289 |
* @since 1.5 |
|
290 |
*/ |
|
291 |
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { |
|
292 |
throw new AssertionError("All subclasses should override this method"); |
|
293 |
} |
|
294 |
||
295 |
/** |
|
16051
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
296 |
* {@inheritDoc} |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
297 |
* @throws NullPointerException {@inheritDoc} |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
298 |
* @since 1.5 |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
299 |
*/ |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
300 |
@Override |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
301 |
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
302 |
return AnnotatedElement.super.isAnnotationPresent(annotationClass); |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
303 |
} |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
304 |
|
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
305 |
/** |
2 | 306 |
* @throws NullPointerException {@inheritDoc} |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
307 |
* @since 1.8 |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
308 |
*/ |
15659
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
309 |
@Override |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
310 |
public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) { |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
311 |
throw new AssertionError("All subclasses should override this method"); |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
312 |
} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
313 |
|
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
314 |
/** |
2 | 315 |
* @since 1.5 |
316 |
*/ |
|
317 |
public Annotation[] getAnnotations() { |
|
318 |
return getDeclaredAnnotations(); |
|
319 |
} |
|
320 |
||
321 |
/** |
|
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
322 |
* @throws NullPointerException {@inheritDoc} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
323 |
* @since 1.8 |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
324 |
*/ |
15659
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
325 |
@Override |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
326 |
public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) { |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
327 |
// Only annotations on classes are inherited, for all other |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
328 |
// objects getDeclaredAnnotation is the same as |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
329 |
// getAnnotation. |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
330 |
return getAnnotation(annotationClass); |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
331 |
} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
332 |
|
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
333 |
/** |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
334 |
* @throws NullPointerException {@inheritDoc} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
335 |
* @since 1.8 |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
336 |
*/ |
15659
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
337 |
@Override |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
338 |
public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) { |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
339 |
// Only annotations on classes are inherited, for all other |
15659
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
340 |
// objects getDeclaredAnnotationsByType is the same as |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
341 |
// getAnnotationsByType. |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
342 |
return getAnnotationsByType(annotationClass); |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
343 |
} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
344 |
|
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
345 |
/** |
2 | 346 |
* @since 1.5 |
347 |
*/ |
|
348 |
public Annotation[] getDeclaredAnnotations() { |
|
349 |
throw new AssertionError("All subclasses should override this method"); |
|
350 |
} |
|
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
351 |
|
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
352 |
|
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
353 |
// Shared access checking logic. |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
354 |
|
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
355 |
// For non-public members or members in package-private classes, |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
356 |
// it is necessary to perform somewhat expensive security checks. |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
357 |
// If the security check succeeds for a given class, it will |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
358 |
// always succeed (it is not affected by the granting or revoking |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
359 |
// of permissions); we speed up the check in the common case by |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
360 |
// remembering the last Class for which the check succeeded. |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
361 |
// |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
362 |
// The simple security check for Constructor is to see if |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
363 |
// the caller has already been seen, verified, and cached. |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
364 |
// (See also Class.newInstance(), which uses a similar method.) |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
365 |
// |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
366 |
// A more complicated security check cache is needed for Method and Field |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
367 |
// The cache can be either null (empty cache), a 2-array of {caller,targetClass}, |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
368 |
// or a caller (with targetClass implicitly equal to memberClass). |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
369 |
// In the 2-array case, the targetClass is always different from the memberClass. |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
370 |
volatile Object securityCheckCache; |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
371 |
|
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
372 |
final void checkAccess(Class<?> caller, Class<?> memberClass, |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
373 |
Class<?> targetClass, int modifiers) |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
374 |
throws IllegalAccessException |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
375 |
{ |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
376 |
if (caller == memberClass) { // quick check |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
377 |
return; // ACCESS IS OK |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
378 |
} |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
379 |
Object cache = securityCheckCache; // read volatile |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
380 |
if (targetClass != null // instance member or constructor |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
381 |
&& Modifier.isProtected(modifiers) |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
382 |
&& targetClass != memberClass) { |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
383 |
// Must match a 2-list of { caller, targetClass }. |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
384 |
if (cache instanceof Class[]) { |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
385 |
Class<?>[] cache2 = (Class<?>[]) cache; |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
386 |
if (cache2[1] == targetClass && |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
387 |
cache2[0] == caller) { |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
388 |
return; // ACCESS IS OK |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
389 |
} |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
390 |
// (Test cache[1] first since range check for [1] |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
391 |
// subsumes range check for [0].) |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
392 |
} |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
393 |
} else if (cache == caller) { |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
394 |
// Non-protected case (or targetClass == memberClass or static member). |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
395 |
return; // ACCESS IS OK |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
396 |
} |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
397 |
|
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
398 |
// If no return, fall through to the slow path. |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
399 |
slowCheckMemberAccess(caller, memberClass, targetClass, modifiers); |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
400 |
} |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
401 |
|
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
402 |
// Keep all this slow stuff out of line: |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
403 |
void slowCheckMemberAccess(Class<?> caller, Class<?> memberClass, |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
404 |
Class<?> targetClass, int modifiers) |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
405 |
throws IllegalAccessException |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
406 |
{ |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
407 |
Reflection.ensureMemberAccess(caller, memberClass, targetClass, modifiers); |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
408 |
|
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
409 |
// Success: Update the cache. |
41560
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
410 |
Object cache = (targetClass != null |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
411 |
&& Modifier.isProtected(modifiers) |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
412 |
&& targetClass != memberClass) |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
413 |
? new Class<?>[] { caller, targetClass } |
a66e7ee16cf9
6378384: (reflect) subclass can’t access superclass’s protected fields and methods by reflection
plevart
parents:
37363
diff
changeset
|
414 |
: caller; |
9029
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
415 |
|
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
416 |
// Note: The two cache elements are not volatile, |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
417 |
// but they are effectively final. The Java memory model |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
418 |
// guarantees that the initializing stores for the cache |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
419 |
// elements will occur before the volatile write. |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
420 |
securityCheckCache = cache; // write volatile |
e92fcf58f684
6565585: Remove critical section in Method.invoke, Constructor.newInstance, Field.getFieldAccessor improving performance
mduigou
parents:
5506
diff
changeset
|
421 |
} |
2 | 422 |
} |