Community
Participate
Working Groups
I20100112-0800. The deprecation warning for a type should not include the package name. Test Case: 1. paste the following snippet into the Package Explorer. package a.b.c.d; /** @deprecated */ public class Deprecated { } package a.b.c.d; public class T { a.b.c.d.Deprecated f; } ==> the deprecation warning covers "a.b.c.d.Deprecated" but should only cover the type name ("Deprecated") since the package itself is not deprecated. This is similar to deprecated methods where we also only mark the method as deprecated. See also bug 169995.
Ayush, can you please take a look ? This sounds similar to some of your recent fixes, Thanks!
Created attachment 162250 [details] proposed fix v1.0 + regression tests The above patch takes care of not just the warning marker for types, but also for method and constructor invocations. The changes in ProblemReporter pertain to setting the starting point of the marker to the correct location. Also, QualifiedTypeReference#getTypeBinding(Scope) had an erroneous checking condition 'i<last' which is changed here to 'i<=last'. This method is called in TypeReference#internalResolveType on line 131. The getTypeBinding already checks for deprecation so there's no need to double check for deprecation after its call on line TypeReference.java:131 - which was being done on TypeReference.java:148. The same duplication of checkin for deprecation is avoided by the change on JavadocQualifiedTypeRef:59. As a side effect, some new "The type * is never used locally" warnings have come out. This is because the method for checking deprecation - QualifiedTypeRef#isTypeUseDeprecated affects the AccLocallyUsed bit and due to the erroneous i<last condition in getTypeBinding, the isTypeUseDeprecated was not being called in some cases. This also addresses bug 169995.
Olivier, since you worked on bug 132677, which was a close relative of this one, I guess it'd be best if you reviewed the changes here. Thanks!
Looks good.
Created attachment 162429 [details] Same patch with copyright updates
Released for 3.6M7. Updated existing regression tests.
I think this should be marked as a dup of bug 169995
*** Bug 169995 has been marked as a duplicate of this bug. ***
Verified in HEAD.