-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bug about the generateReturnAndInvocation method of the class AdaptiveClassCodeGenerator #4339
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4339 +/- ##
============================================
- Coverage 62.88% 62.27% -0.62%
+ Complexity 505 504 -1
============================================
Files 769 790 +21
Lines 32995 34844 +1849
Branches 5215 5456 +241
============================================
+ Hits 20748 21698 +950
- Misses 9845 10639 +794
- Partials 2402 2507 +105
Continue to review full report at Codecov.
|
jdk version: 1.8.0_172 , compilation options : -parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced.
Would you mind to provide a sample code to help me to understand the scenario?
I think I understand what happens, you use 'javac -parameters' to compile. In this case, we should consider to enhance method signature generation instead, in my opinion. |
second thought, I went through the code again, there are lots of code based on 'arg%d' format. I agree your change is minimal. I will consider to merge. |
Sorry, I think the file committed is a little confused because it delete a file and add an almost same file. It' s difficult to identify the diff |
What is the purpose of the change
我发现在调用被代理的方法时,使用的参数名是该方法自身定义的旧的参数名,然而我们在生成代理类的过程中重载该方法时已经将参数名重新定义为arg为首,index为尾的参数名,例如arg0,arg1...。当使用旧的参数名调用被代理方法时,编译会出现错误,因为我们的局部变量之中已经不存在旧的参数名了,所以在调用被代理方法时应该使用新的参数名。
I found that when calling the proxy method, the parameter name used is the old parameter name defined by the method itself. However, when we overload the method in the process of generating the proxy class, we have redefined the parameter name as arg first and index tail, such as arg0, arg1.... When the proxy method is called with the old parameter name, compilation errors occur because the old parameter name does not exist in our local variables, so we should use the new parameter name when calling the proxy method.
Brief changelog
XXXXX
Verifying this change
XXXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.