Details
-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
6
-
x86
-
windows_xp
Description
FULL PRODUCT VERSION :
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
According to JLS 3:
A Java compiler must produce a warning when a deprecated type, method, field, or constructor is used (overridden, invoked, or referenced by name) unless:
* The use is within an entity that itself is is annotated with the annotation @Deprecated
* ...
However the compiler issues deprecation warnings for uses of deprecated API that are themselves within deprecated entities.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
ClassA.java:
@Deprecated public class ClassA {}
ClassB.java:
@Deprecated public class ClassB {
public ClassA myvar() {return new ClassA();}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No warnings.
ACTUAL -
Deprecation warnings.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Note: ClassB.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
None. This bug is also in the 5.0 compiler. @SuppressWarnings("deprecation") doesn't work in the 6.0 compiler but it does work in the 5.0 compiler.
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
According to JLS 3:
A Java compiler must produce a warning when a deprecated type, method, field, or constructor is used (overridden, invoked, or referenced by name) unless:
* The use is within an entity that itself is is annotated with the annotation @Deprecated
* ...
However the compiler issues deprecation warnings for uses of deprecated API that are themselves within deprecated entities.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
ClassA.java:
@Deprecated public class ClassA {}
ClassB.java:
@Deprecated public class ClassB {
public ClassA myvar() {return new ClassA();}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No warnings.
ACTUAL -
Deprecation warnings.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Note: ClassB.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
None. This bug is also in the 5.0 compiler. @SuppressWarnings("deprecation") doesn't work in the 6.0 compiler but it does work in the 5.0 compiler.