Bug 230830

Summary: [select] Search doesn't find annotated local variable declaration with error
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: frederic_fusier, Olivier_Thomann
Version: 3.4   
Target Milestone: 3.5 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description David Audel CLA 2008-05-07 03:51:58 EDT
build I20080502-0100
1) create X.java
public class X {
  void foo() {
    @A(n=) String s;
  }
}

2) select 's'
3) search declaration of s (right click>Declarations>Project)
There is no search result.
Comment 1 David Audel CLA 2008-05-07 03:52:55 EDT
This problem is caused be the fact that code select doesn't do annotations recovery or statements recovery in the SelectionParser and search do annotations recovery and statements recovery in MatchLocatorParser.
For select the variable doesn't contain the annotation unlike search.

SelectionParser should support annotations recovery.
Comment 2 David Audel CLA 2008-05-07 03:56:43 EDT
It is too risky to modify code select recovery for 3.4. Deferring to 3.5.
Comment 3 David Audel CLA 2008-07-23 03:22:27 EDT
Created attachment 108164 [details]
Proposed fix
Comment 4 David Audel CLA 2008-07-23 03:25:30 EDT
Released fro 3.5M1.

Tests added
  ResolveTests_1_5#test0117() -> test0118()

Annotation recovery is enabled in SelectionParser
Comment 5 Olivier Thomann CLA 2008-08-06 13:39:12 EDT
Verified for 3.5M1 using I20080805-1307