Bug 52422

Summary: F3 can't find method def'n inside inner (anonymous) class
Product: [Eclipse Project] JDT Reporter: Debbie Wilson <debbie_wilson>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Debbie Wilson CLA 2004-02-18 15:51:45 EST
I20040218
- class PerspectiveRegistry (org.eclipse.ui.workbench/Eclipse 
UI/org.eclipse.ui.internal.registry/PerspectiveRegistry)

I have the project org.eclipse.ui.workbench loaded as source in my 
environment.  Open the class PerspectiveRegistry in the editor.  The 
constructor has the following format:

public PerspectiveRegistry() {
  super();

  IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
  store.addPropertyChangeListener(new IPropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent event) {
      ...
    }

    private void mergePerspectives(PropertyChangeEvent event) {
      ...
      updatePreferenceList(store);
    }

    private void updatePreferenceList(IPreferenceStore store) {
      ...
    }
  });
}

Double click to select the text 'updatePreferenceList' where it is called in 
method mergePerspectives.  Hit F3.  I expected to go to the definition of the 
method updatePreferenceList a couple of lines below.  But instead I got the 
error message "Current text selection doesn't resolve to a Java element".
Comment 1 Martin Aeschlimann CLA 2004-02-20 10:31:44 EST
reproduced this. Set a breakpoint in ICompilationUnit.codeSelect and no result
was returned.
Comment 2 David Audel CLA 2004-05-11 07:30:33 EDT
Simple test case

public class X {
  public void foo() {
    new Object() {
      void bar1() {
        bar2();
      }
      void bar2() {
      }
    };
  }
}
Comment 3 David Audel CLA 2004-05-17 10:48:11 EDT
Fixed and test added
  SelectionTest#test50()
  SelectionTest#test51()
  SelectionTest#test52()
Comment 4 Olivier Thomann CLA 2004-05-18 11:31:53 EDT
Verified in 200405180816