1 package net.sf.crispy.util;
2
3 import java.lang.reflect.Method;
4 import java.security.PrivilegedAction;
5
6 import net.sf.crispy.impl.ServiceManager;
7
8 /**
9 * Check the Permission for <code>setAccessible(true)</code>.
10 *
11 * @author Linke
12 *
13 */
14 public class MethodAccessiblePrivilegedAction implements PrivilegedAction {
15
16 private final Method method;
17
18 public MethodAccessiblePrivilegedAction(Method pvMethod) {
19 method = pvMethod;
20 }
21
22 public Object run() {
23 try {
24 method.setAccessible(true);
25 } catch (Exception e) {
26 if (ServiceManager.DEBUG_MODE_ON == true) {
27 e.printStackTrace();
28 }
29
30 }
31 return null;
32 }
33
34
35 }