Skip to content

Commit

Permalink
changed callChild to static
Browse files Browse the repository at this point in the history
  • Loading branch information
n9Mtq4 committed Aug 5, 2015
1 parent f8a5810 commit f1d2e89
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/com/n9mtq4/reflection/EnhancedProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ public static <E> E newInstance(Object obj, EnhancedInvocationHandler handler) {
return (E) Proxy.newProxyInstance(obj.getClass().getClassLoader(), obj.getClass().getInterfaces(), new EnhancedProxy(obj, handler));
}

private Object obj;
EnhancedInvocationHandler handler;

public EnhancedProxy(Object obj, EnhancedInvocationHandler handler) {
this.obj = obj;
this.handler = handler;
}

public void callChild(Object obj, Method method, Object[] args) {
public static void callChild(Object obj, Method method, Object[] args) {
try {
method.setAccessible(true);
method.invoke(obj, args);
Expand All @@ -33,6 +25,14 @@ public void callChild(Object obj, Method method, Object[] args) {
}
}

private Object obj;
EnhancedInvocationHandler handler;

public EnhancedProxy(Object obj, EnhancedInvocationHandler handler) {
this.obj = obj;
this.handler = handler;
}

@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

Expand Down

0 comments on commit f1d2e89

Please sign in to comment.