Community
Participate
Working Groups
happens on 20030813 from bug 38797: 1 - New workspace, create two Java projects Foo and Bar (Bar references Foo) 2 - Create an interface in Foo: public interface SimpleInterface { public int CONSTANT = 10; } 3 - Create a class in Foo: public class SimpleClass { public static void method() {} } 3 - Create a class in Bar: public class ClientClass { void m1() { int i = SimpleInterface.CONSTANT; SimpleClass.method(); } } 4 - Select CONSTANT in SimpleInterface and "Refactor->Rename..." 5 - Choose the name you want (e.g. CONSTANT_) 6 - Press ok. Bug: "another name shadows access to the renamed element" warning in ClientClass. 7 - Continuing, no errors will be reported, and the operation finishes properly.
it looks like SearchEngine is not reporting 1 match in a working copy. i create working copies for SimpleInterface.java and ClientClass.java, i modify them in memory by renaming CONSTANT to C and reconciling. i then call SearchEngine.search to find ALL_OCCURENCES and give it the 2 working copies. only the declaration is found, the reference is not. this only happens if SimpleInterface and ClientClass are in different projects (both projects are in the search scope) asking jcore for comment
*** Bug 41533 has been marked as a duplicate of this bug. ***
*** Bug 30267 has been marked as a duplicate of this bug. ***
Fixed MatchLocator.locateMatches(JavaProject,PotentialMatch[],int,int) to take working copies in other projects into account as well. Added regression test JavaSearchMultipleProjectsTests.testFieldOccurencesInWorkingCopies()
Verified.