Community
Participate
Working Groups
This bug tracks the following refactoring involving receiver parameter: 1. Receiver parameter is erased during "Extract Super Class" refactoring. public class ExtractSuperCls { public boolean foo(@NonNull ExtractSuperCls this) { return true; } } Invoke "Extract Super Class" on the above class. select #foo to be part of the super class. After refactoring in the newly created class #foo is: public boolean foo() { return true; } Receiver parameter is erased. 2. Receiver parameter is erased during "Pull Up" and "Push Down" of the method.
Created attachment 229660 [details] Patch. This patch contains the code changes required to handled all the refactoring involving receiver parameter. Since the changes were similar it could be a time waste to review each of them separately, hence uploading a single patch for the same. Some code changes are not part of this bug fix, but was required to avoid exception while testing the feature. I have put line comments above those changes. AST parser level should be set to 8 to test the feature. This patch contains the following refactoring involving receiver parameter: 1. Move 2, Extract Interface 3. Extract Superclass 4. Pull Up 5. Push Down Markus, kindly review. If you think it is better to review them separately, I will upload them separately.
Created attachment 229789 [details] Test Patch. This patch contains test cases for the various refactoring involving receiver parameter. Markus, let me know if I have left out any scenario.
*** Bug 404700 has been marked as a duplicate of this bug. ***
*** Bug 404705 has been marked as a duplicate of this bug. ***
*** Bug 404702 has been marked as a duplicate of this bug. ***
*** Bug 404147 has been marked as a duplicate of this bug. ***
Created attachment 235215 [details] Patch with testcases. Took a fresh patch from the newly created remote branch after eliminating the redundant file changes.