Bug 48749

Summary: [Compiler] deprecation check in initializer fooled by trailing deprecated field decl
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 2.1.3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2003-12-15 09:30:32 EST
Build 20031215

On the following code, compiled against deprecated type A, no deprecation check 
is issued (when deprecation inside deprecated code is disabled):

public class X  {
    int x;
    {
        x = y;
    }
    {
       new A(null);
    }
    /**
     * @deprecated
     */
    int y;
}
Comment 1 Philipe Mulet CLA 2003-12-15 09:31:49 EST
This is due to the fact that the trailing field declaration is tagged as being 
deprecated, and the initializer incorrectly thinks it is inside this field 
declaration (as it shares the fieldDeclarationIndex field value).
Comment 2 Philipe Mulet CLA 2003-12-15 11:31:05 EST
Fixed.
Comment 3 Jerome Lanneluc CLA 2003-12-16 17:03:10 EST
Verified in I200312161200
Comment 4 Frederic Fusier CLA 2004-03-01 07:17:51 EST
Backported to 2.1 stream.
Verified for 2.1.3 with build I200402251535.
Comment 5 Frederic Fusier CLA 2004-03-01 12:09:14 EST
Build was M200402251535 and not I200402251535....