Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
1 /*
2 * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
24 // WARNING: this file much be compiled first before DeprecatedDocCommentTest.java
25 // in test/tools/javac/ is compiled. This is because the compiler *does not*
26 // print deprecation warnings for a file currently being compiled.
28 // If this file fails to compile, then the test has failed. The test does not
29 // need to be run.
31 //package depDocComment ;
33 public class DeprecatedDocComment2 {
35 public static void main(String argv[]) {
37 // should just skip over this one
38 System.out.println("Hello World");
40 /* and this one too */
41 System.out.println("Hello World");
43 }
45 /**
46 * @deprecated The compiler should print out deprecation warning for this
47 * function
48 */
49 public static void deprecatedTest1() {
50 System.out.println("1");
51 }
53 /*
54 * @deprecated The compiler should not print deprecation warning since this
55 * is not a legal docComment
56 */
57 public static void deprecatedTest2() {
58 System.out.println("1");
59 }
61 /*
62 * @deprecated Nor this one */
63 public static void deprecatedTest3() {
64 System.out.println("1");
65 }
67 /* @deprecated Nor this */
68 public static void deprecatedTest4() {
69 System.out.println("1");
70 }
72 /** @deprecated But it should for this */
73 public static void deprecatedTest5() {
74 System.out.println("1");
75 }
77 /**@deprecated But it should for this*/
78 public static void deprecatedTest6() {
79 System.out.println("1");
80 }
82 /*
83 @deprecated But not for this
84 */
85 public static void deprecatedTest7() {
86 System.out.println("1");
87 }
91 /**
92 * not at the beginning of line @deprecated But not for this
93 */
94 public static void deprecatedTest8() {
95 System.out.println("1");
96 }
98 }