Community
Participate
Working Groups
Build I20050527-1300. Test classes: --- X package p; import java.io.Serializable; public interface X<T extends X<T, U, V>, U extends X.XX<T, V>, V extends X.XY> { public interface XX<TT extends X<TT, ?, UU>, UU extends X.XY> extends Serializable { } public interface XY extends Serializable { } } --- Y package p; public class Y<T extends X<T, U, V>, U extends X.XX<T, V>, V extends X.XY> { } --- W package p; import java.util.*; import p.X.*; public class W { private final Map<String, Y<?, ? extends XX<?, ?>, ? >> m1 = null; // (a) public void getStore(final Object o) { m1.get(o); // (b) } } Scenario: - select W.m1 on line (a); - launch refactor/rename; - enter m2 as new name; - Finish. The expected result would be that m1 occurrences on lines (a) and (b) get changed to m2. Only the one of line (a) gets changed. Note that deleting the import p.X.* clause and using the fully qualified X.XX type in the bound of m1 declaration suppresses the problem. This might be related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=97547, which is also related to member types imports.
Markus, can you please investigate.
Moving to JDT/Core for comments. The RenameFieldProcessor searches for SearchPattern.createPattern(fField, IJavaSearchConstants.REFERENCES), but the search engine does not report the reference (b). When I add rule SearchPattern.R_ERASURE_MATCH to the pattern, then the search engine also reports (b). However, R_ERASURE_MATCH's javadoc says that it has no effect on field searches.
Created attachment 22912 [details] Patch to fix this issue Currently field declaring type is resolved using parameterized type. Need to use erausre instead to avoid that field search will be dependent on R_ERASURE_MATCH pattern rule.
Created attachment 22913 [details] Test case added to JavaSearchBugsTests
+1 for RC3 Dirk - pls vote for this one. See impact on refactoring
I've run JDT-UI tests (refactoring & automated) and they all pass...
Forgot to CC Dirk to obtain vote
+1.
Fixed and released in HEAD.
Verified using build N20050616-0010 + JDT Core HEAD.