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

Bug 119628

Summary: [search] Search for declarations of method in anonymous type reports unrelated methods in local classes
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-12-07 09:06:04 EST
I20051206-1200

Search for declarations of the first method foo() in the example below reports both other foo() methods too, although they are not related.
Search for declarations of Local#foo() correctly reports only that method.

public class Foo {
    public void test() {
        Foo b= new Foo() {
            public void foo() { }
        };
        Foo c= new Foo() {
            public void foo() { }
        };
        {
            class Local {
                public void foo() { }
            };
        }
    }
}

To reproduce, don't use Search > Declarations > ..., since those actions ignore the declaring type. Use the Search dialog or Refactor > Rename.

Low priority for me, since the example is rather contrived.
Comment 1 Frederic Fusier CLA 2006-04-12 09:24:30 EDT
Defer post 3.2
Comment 2 Frederic Fusier CLA 2007-06-21 10:34:13 EDT
Reopen as LATER is deprecated...
Comment 3 Frederic Fusier CLA 2007-06-21 10:34:37 EDT

*** This bug has been marked as a duplicate of bug 117028 ***