|
1 /* |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 8025272 |
|
4 * @summary doclint needs to check for valid usage of at-value tag |
|
5 * @build DocLintTester |
|
6 * @run main DocLintTester -ref ValueTest.out ValueTest.java |
|
7 */ |
|
8 |
|
9 /** */ |
|
10 public class ValueTest { |
|
11 /* |
|
12 * Tests for {@value} without a reference |
|
13 */ |
|
14 |
|
15 /** valid: {@value} */ |
|
16 public static final boolean cBoolean = false; |
|
17 |
|
18 /** valid: {@value} */ |
|
19 public static final byte cByte = 0; |
|
20 |
|
21 /** valid: {@value} */ |
|
22 public static final short cShort = 0; |
|
23 |
|
24 /** valid: {@value} */ |
|
25 public static final int cInt = 0; |
|
26 |
|
27 /** valid: {@value} */ |
|
28 public static final long cLong = 0L; |
|
29 |
|
30 /** valid: {@value} */ |
|
31 public static final float cFloat = 0.0f; |
|
32 |
|
33 /** valid: {@value} */ |
|
34 public static final double cDouble = 0.0; |
|
35 |
|
36 /** valid: {@value} */ |
|
37 public static final String cString = ""; |
|
38 |
|
39 /** invalid class C: {@value} */ |
|
40 public class C { } |
|
41 |
|
42 /** invalid enum E: {@value} */ |
|
43 public enum E { |
|
44 /** invalid enum constant E1: {@value} */ |
|
45 E1 |
|
46 } |
|
47 |
|
48 /** invalid field 1: {@value} */ |
|
49 public int f1; |
|
50 |
|
51 /** invalid field 2: {@value} */ |
|
52 public int f2 = 3; |
|
53 |
|
54 |
|
55 /* |
|
56 * Tests for {@value} with a reference |
|
57 */ |
|
58 |
|
59 /** valid: {@value Integer#SIZE} */ |
|
60 public int intRef; |
|
61 |
|
62 /** invalid method: {@value Object#toString} */ |
|
63 public int badMethod; |
|
64 |
|
65 /** invalid enum constant: {@value Thread.State#NEW} */ |
|
66 public int badEnum; |
|
67 } |