author | naoto |
Tue, 29 Mar 2016 17:06:33 -0700 | |
changeset 36739 | 145210aba850 |
parent 30730 | d3ce7619db2c |
permissions | -rw-r--r-- |
14952 | 1 |
/* |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
14962
diff
changeset
|
2 |
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
14952 | 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 |
*/ |
|
23 |
||
24 |
/* |
|
25 |
* @test |
|
14962 | 26 |
* @bug 8004832 |
27 |
* @summary Add new doclint package |
|
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
14962
diff
changeset
|
28 |
* @modules jdk.compiler/com.sun.tools.doclint |
14952 | 29 |
* @build DocLintTester |
30 |
* @run main DocLintTester -Xmsgs:all OverridesTest.java |
|
31 |
*/ |
|
32 |
||
33 |
/* |
|
34 |
* This is a test that missing comments on methods may be inherited |
|
35 |
* from overridden methods. As such, there should be no errors due |
|
36 |
* to missing comments (or any other types of error) in this test. |
|
37 |
*/ |
|
38 |
||
39 |
/** An interface. */ |
|
40 |
interface I1 { |
|
41 |
/** |
|
42 |
* A method |
|
43 |
* @param p a param |
|
44 |
* @throws Exception an exception |
|
45 |
* @return an int |
|
46 |
*/ |
|
47 |
int m(int p) throws Exception; |
|
48 |
} |
|
49 |
||
50 |
/** An extending interface. */ |
|
51 |
interface I2 extends I1 { } |
|
52 |
||
53 |
/** An abstract class. */ |
|
54 |
abstract class C1 { |
|
55 |
/** |
|
56 |
* A method |
|
57 |
* @param p a param |
|
58 |
* @throws Exception an exception |
|
59 |
* @return an int |
|
60 |
*/ |
|
61 |
int m(int p) throws Exception; |
|
62 |
} |
|
63 |
||
64 |
/** An implementing class. */ |
|
65 |
class C2 implements I1 { |
|
66 |
int m(int p) throws Exception { return p; } |
|
67 |
} |
|
68 |
||
69 |
/** An extending class. */ |
|
70 |
class C3 extends C1 { |
|
71 |
int m(int p) throws Exception { return p; } |
|
72 |
} |
|
73 |
||
74 |
/** An extending and implementing class. */ |
|
75 |
class C4 extends C1 implements I1 { |
|
76 |
int m(int p) throws Exception { return p; } |
|
77 |
} |
|
78 |
||
79 |
/** An implementing class using inheritdoc. */ |
|
80 |
class C5 implements I1 { |
|
81 |
/** {@inheritDoc} */ |
|
82 |
int m(int p) throws Exception { return p; } |
|
83 |
} |
|
84 |
||
85 |
/** An implementing class with incomplete documentation. */ |
|
86 |
class C6 implements I1 { |
|
87 |
/** Overriding method */ |
|
88 |
int m(int p) throws Exception { return p; } |
|
89 |
} |
|
90 |
||
91 |
/** A class implementing an inherited interface. */ |
|
92 |
class C7 implements I2 { |
|
93 |
int m(int p) throws Exception { return p; } |
|
94 |
} |