Bug 405270 - [1.8][refactoring] Handling of receiver parameter during UI refactoring
Summary: [1.8][refactoring] Handling of receiver parameter during UI refactoring
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: BETA J8   Edit
Assignee: Martin Mathew CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 404147 404700 404702 404705 (view as bug list)
Depends on: 395612
Blocks:
  Show dependency tree
 
Reported: 2013-04-09 08:24 EDT by Martin Mathew CLA
Modified: 2013-09-06 01:35 EDT (History)
2 users (show)

See Also:
manju656: review? (markus.kell.r)


Attachments
Patch. (34.46 KB, patch)
2013-04-12 04:06 EDT, Martin Mathew CLA
no flags Details | Diff
Test Patch. (32.81 KB, patch)
2013-04-17 04:57 EDT, Martin Mathew CLA
no flags Details | Diff
Patch with testcases. (63.04 KB, patch)
2013-09-06 01:35 EDT, Martin Mathew CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mathew CLA 2013-04-09 08:24:08 EDT
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.
Comment 1 Martin Mathew CLA 2013-04-12 04:06:12 EDT
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.
Comment 2 Martin Mathew CLA 2013-04-17 04:57:06 EDT
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.
Comment 3 Martin Mathew CLA 2013-09-06 00:04:27 EDT
*** Bug 404700 has been marked as a duplicate of this bug. ***
Comment 4 Martin Mathew CLA 2013-09-06 00:05:39 EDT
*** Bug 404705 has been marked as a duplicate of this bug. ***
Comment 5 Martin Mathew CLA 2013-09-06 00:07:33 EDT
*** Bug 404702 has been marked as a duplicate of this bug. ***
Comment 6 Martin Mathew CLA 2013-09-06 00:09:32 EDT
*** Bug 404147 has been marked as a duplicate of this bug. ***
Comment 7 Martin Mathew CLA 2013-09-06 01:35:53 EDT
Created attachment 235215 [details]
Patch with testcases.

Took a fresh patch from the newly created remote branch after eliminating the redundant file changes.