Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318522

Summary: [refactoring] [plan] Rename of ITD Getters and setters fails in some situations
Product: [Tools] AJDT Reporter: Andrew Eisenberg <andrew.eisenberg>
Component: CoreAssignee: AJDT-inbox <AJDT-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3    
Version: 2.1.0   
Target Milestone: 2.1.2   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

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.