Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318522 - [refactoring] [plan] Rename of ITD Getters and setters fails in some situations
Summary: [refactoring] [plan] Rename of ITD Getters and setters fails in some situations
Status: NEW
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: 2.1.0   Edit
Hardware: Macintosh Mac OS X
: P3 major (vote)
Target Milestone: 2.1.2   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 17:02 EDT by Andrew Eisenberg CLA
Modified: 2010-12-08 19:59 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2010-06-30 17:02:06 EDT
Rename of ITD Getters and setters renames incorrect references when there are multuple ITD getters or setters around for fields of the same name, but in a different type.

Example:

public class C1 {
	private String name;
}
public class C2 {
	private String name;
}

public privileged aspect A1 {
	public String C1.getName() {
		getName();
		return name;
	}
}
public privileged aspect A2 {
	public String C2.getName() {
		getName();
		return name;
	}
}


Rename C1.name.  Notice that the reference to getName() in A2 is renamed as well.

The reason this is happening is that the MatchLocator does not know the owner type of the errant getName() and so includes it as a potential match.  This is something that JDT does outside of anything that AJDT does.

It is easy enough for AJDT to determine if a match of this kind found by JDT should really be filtered out, but it is not so easy to go through the requestor and perform the filtering on every one of the matches.  This is because there is no API for getting all matches inside a search requestor.  I would have to resort to reflection.