Bug 48749 - [Compiler] deprecation check in initializer fooled by trailing deprecated field decl
Summary: [Compiler] deprecation check in initializer fooled by trailing deprecated fie...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1.3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-15 09:30 EST by Philipe Mulet CLA
Modified: 2004-03-01 12:09 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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....