Community
Participate
Working Groups
Using 1216, we don't report a deprecation warning in this case: 1) Compile this code: [ public class X { /** * @deprecated */ public static class Y { } } ] 2) delete the source X.java 3) compile this class putting the previous .class file on the classpath: class A extends X.Y { } We don't report any deprecation warning, but we do if you move the javadoc comment on the top level class.
Seems like the AccDeprecated flag isn't properly propagated through member types.
X$Y is tagged as deprecated. The problem seems to be the detection of the usage of deprecated classes when the class is a member type.
The bug came from the getModifiers() method on ClassFileReader. If the classfile reader had a inner info (it is an inner class) the modifiers were the inner infos modifiers and not the access flags. The AccDeprecated flag was contained only in the access flags value and not in the inner attribute.
This method should be changed for: public int getModifiers() { if (this.innerInfo != null) { if ((this.accessFlags & AccDeprecated) != 0) { return this.innerInfo.getModifiers() | AccDeprecated; } else { return this.innerInfo.getModifiers(); } } return this.accessFlags; } This fixes the problem.
Fixed and released in 2.1 stream. Regression test added.
Verified.