对问题抽象一下:
现在有一个原始类:
```java
public class Person {
public void test() {
System.out.println("123");
}
}
```
利用javassist生成一个代理类:
```java
public class PersonProxy {
private Handler handler = new Handler();
public void test() {
handler.invoker(this, test方法对象, test方法参数);
}
}
public class Handler {
void invoker(Object object, Method method, Object[] args) {
method.invoke(object, args);
};
}
```
以上情况是正常的,
如果此时在原始Person类中增加一个static方法就会出现问题
比如增加一个方法
```java
public static void test111() {
System.out.println("123");
}
```
按现有的代理逻辑,会生成如下类:
```java
public class PersonProxy {
private Handler handler;
public static void test111() {
handler.invoker(this, test111方法对象, test111方法参数);
}
}
```
此时上面生成的代理类有两个地方会编译出错,handler与this在static方法中是不能使用的。
[ Full content available at: https://github.com/apache/dubbo/issues/4894 ]
This message was relayed via gitbox.apache.org for
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]