< prev index next >

test/langtools/tools/javac/depDocComment/SuppressDeprecation.java

Print this page


   1 /**
   2  * @test  /nodynamiccopyright/
   3  * @bug 4216683 4346296 4656556 4785453 8164073
   4  * @summary New rules for when deprecation messages are suppressed
   5  * @author gafter
   6  *
   7  * @compile/ref=SuppressDeprecation.out -Xlint:deprecation -XDrawDiagnostics SuppressDeprecation.java
   8  * @compile/ref=SuppressDeprecation8.out -source 8 -Xlint:deprecation -XDrawDiagnostics SuppressDeprecation.java
   9  */
  10 
  11 /* Test for the contexts in which deprecations warnings should
  12  * (and should not) be given.  They should be given when
  13  * o  invoking a deprecated method from a non-deprecated one.
  14  * o  new X() using a deprecated constructor
  15  * o  super() to a deprecated constructor
  16  * o  extending a deprecated class.
  17  * But deprecation messages are suppressed as follows:
  18  * o  Never complain about code in the same outermost class as
  19  *    the deprecated entity.
  20  * o  Extending a deprecated class with a deprecated one is OK.
  21  * o  Overriding a deprecated method with a deprecated one is OK.
  22  * o  Code appearing in a deprecated class is OK.
  23  *
  24  */
  25 
  26 class T {
  27     /** var.
  28      *  @deprecated . */


   1 /**
   2  * @test  /nodynamiccopyright/
   3  * @bug 4216683 4346296 4656556 4785453 8164073
   4  * @summary New rules for when deprecation messages are suppressed
   5  * @author gafter
   6  *
   7  * @compile/ref=SuppressDeprecation.out -Xlint:deprecation -XDrawDiagnostics SuppressDeprecation.java
   8  * @compile/ref=SuppressDeprecation8.out -source 8 -Xlint:deprecation -XDrawDiagnostics -Xlint:-options SuppressDeprecation.java
   9  */
  10 
  11 /* Test for the contexts in which deprecations warnings should
  12  * (and should not) be given.  They should be given when
  13  * o  invoking a deprecated method from a non-deprecated one.
  14  * o  new X() using a deprecated constructor
  15  * o  super() to a deprecated constructor
  16  * o  extending a deprecated class.
  17  * But deprecation messages are suppressed as follows:
  18  * o  Never complain about code in the same outermost class as
  19  *    the deprecated entity.
  20  * o  Extending a deprecated class with a deprecated one is OK.
  21  * o  Overriding a deprecated method with a deprecated one is OK.
  22  * o  Code appearing in a deprecated class is OK.
  23  *
  24  */
  25 
  26 class T {
  27     /** var.
  28      *  @deprecated . */


< prev index next >