19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
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.
24 */
25
26 package sun.nio.ch;
27
28 import java.io.*;
29 import java.lang.reflect.*;
30 import java.security.AccessController;
31 import java.security.PrivilegedAction;
32
33
34 class Reflect { // package-private
35
36 private Reflect() { }
37
38 private static class ReflectionError extends Error {
39 private static final long serialVersionUID = -8659519328078164097L;
40 ReflectionError(Throwable x) {
41 super(x);
42 }
43 }
44
45 private static void setAccessible(final AccessibleObject ao) {
46 AccessController.doPrivileged(new PrivilegedAction<Void>() {
47 public Void run() {
48 ao.setAccessible(true);
49 return null;
50 }});
51 }
52
53 static Constructor<?> lookupConstructor(String className,
54 Class<?>[] paramTypes)
55 {
56 try {
57 Class<?> cl = Class.forName(className);
58 Constructor<?> c = cl.getDeclaredConstructor(paramTypes);
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
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.
24 */
25
26 package sun.nio.ch;
27
28 import java.io.*;
29 import java.lang.reflect.*;
30 import java.security.AccessController;
31 import java.security.PrivilegedAction;
32
33
34 class Reflect { // package-private
35
36 private Reflect() { }
37
38 private static class ReflectionError extends Error {
39 @java.io.Serial
40 private static final long serialVersionUID = -8659519328078164097L;
41 ReflectionError(Throwable x) {
42 super(x);
43 }
44 }
45
46 private static void setAccessible(final AccessibleObject ao) {
47 AccessController.doPrivileged(new PrivilegedAction<Void>() {
48 public Void run() {
49 ao.setAccessible(true);
50 return null;
51 }});
52 }
53
54 static Constructor<?> lookupConstructor(String className,
55 Class<?>[] paramTypes)
56 {
57 try {
58 Class<?> cl = Class.forName(className);
59 Constructor<?> c = cl.getDeclaredConstructor(paramTypes);
|