Bug 88174

Summary: [1.5][search][enum] method declarations not found in anonymous enum
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 88167    

Description Markus Keller CLA 2005-03-16 09:32:31 EST
v_541

Adapted from bug 88167: Search for declarations of method getTheValue() does not
find the method in the anonymous enum. Neither works with string pattern nor
with java element search.

public enum Test{
  a {
    @Override
    int getTheValue() { // not found
      return 0;
    }
  };
  abstract int getTheValue();
}
Comment 1 Frederic Fusier CLA 2005-04-26 08:06:11 EDT
Fixed and released in HEAD.

[jdt-core-internal]
Changes done in MatchLocator:
  - LocalDeclarationVisitor.visit(TypeDeclaration): back to initial implementation
    (ie. before enum search implementation)
  - reportMatching(FieldDeclaration,...): in type hierarchy, report on field 
    declaration when node is anonymous type declaration of an enum field

Test case added in JavaSearchBugsTests + modify existing JavaSearch.testEnum05()
Comment 2 Maxime Daniel CLA 2005-05-12 04:03:59 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.