Bug 161214 - [compiler] Fup on bug 159709: improve deprecation marks propagation
Summary: [compiler] Fup on bug 159709: improve deprecation marks propagation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-17 07:57 EDT by Maxime Daniel CLA
Modified: 2007-09-07 05:00 EDT (History)
1 user (show)

See Also:


Attachments
Fix for item #1 - do not apply as is (2.72 KB, patch)
2006-10-18 09:22 EDT, Maxime Daniel CLA
no flags Details | Diff
Suggested fix (25.80 KB, patch)
2006-10-19 05:46 EDT, Maxime Daniel CLA
no flags Details | Diff
Reviewed fix (24.98 KB, patch)
2006-10-20 09:49 EDT, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2006-10-17 07:57:46 EDT
 
Comment 1 Maxime Daniel CLA 2006-10-18 05:52:22 EDT
Several improvements have been suggested by Philippe here:
- deprecation related modifiers should be consistent before any call to initializeDeprecatedAnnotationTagBits when the @deprecated javadoc tag is used on an enclosing class; while this does not suppress the need to update the modifiers in initializeDeprecatedAnnotationTagBits when @Deprecated annotation is (solely) used, this calls for a fix in ClassScope#checkAndSetModifiers; to test the result, remove the fix for bug 159709 and check that DeprecatedTest#15 still passes;
- LocalTypeBinding should probably be aligned with MemberTypeBinding relatively to deprecation propagation;
- consider introducing a new tag bit that would explicitly mark the fact that @Deprecated annotations have been checked (whether some have been found *or not*); this could significantly cut down the number of cycles spent into initializeDeprecatedAnnotationTagBits;
- consider protecting calls to initializeDeprecatedAnnotationTagBits accordingly, saving method calls.
Comment 2 Maxime Daniel CLA 2006-10-18 09:22:54 EDT
Created attachment 52221 [details]
Fix for item #1 - do not apply as is

This (small) fix passes DeprecatedTest#15 and fails Deprecated15Test#2 as expected. Do not release as is, only posting to trace progress.
Comment 3 Maxime Daniel CLA 2006-10-18 10:24:06 EDT
Stepping through Deprecated15Test#3 under the debugger shows that forward references to local types, in the rare circumstances in which they can exist at all, are properly tagged before the call to initializeDeprecatedAnnotationTagBits.  Hence no modification of the latter is needed. Note that the test would not break if it was not so, because we do not report the uses of a deprecated type in the same compilation unit as its declaration anyway.
Comment 4 Maxime Daniel CLA 2006-10-19 05:46:10 EDT
Created attachment 52301 [details]
Suggested fix

This fix passes Deprecated15Test again, but having introduced and made use of a new tag bit: DeprecatedAnnotationResolved. It also places the responsibility of checking that tag bit on callers of initializeDeprecatedAnnotationTagBits instead of initializeDeprecatedAnnotationTagBits implementation, potentially saving many calls (one per second and following uses of types forward references, plus a few in member types enclosing type verification).
Patch is currently under test.
Philippe please let me know what you think.
Comment 5 Maxime Daniel CLA 2006-10-19 07:29:40 EDT
Tests ran OK.
Comment 6 Maxime Daniel CLA 2006-10-20 09:49:06 EDT
Created attachment 52391 [details]
Reviewed fix

Mainly:
- decided against protecting outside of initializeDeprecatedAnnotationTagBits, 
  protected within it;
- suppressed the mask that combined tag bits AnnotationResolved and 
  DeprecatedAnnotationResolved.
Comment 7 Maxime Daniel CLA 2006-10-23 03:59:54 EDT
Released for 3.3 M3.
Comment 8 Frederic Fusier CLA 2007-09-07 05:00:17 EDT
Verified code using History...