/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4780441 4874845 4978816
* @summary Make sure that when the -private flag is not used, members
* inherited from package private class are documented in the child.
*
* Make sure that when a method inherits documentation from a method
* is not mentioned anywhere (not even in the signature or tree).
*
* Make sure that when a private interface method with generic parameters
* is implemented, the comments can be inherited properly.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestPrivateClasses
* @run main TestPrivateClasses
*/
//Test information.
//Javadoc arguments.
};
"-source", "1.5", "pkg", "pkg2"
};
// Test output when -private flag is not used.
// Field inheritence from non-public superclass.
"<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" +
"fieldInheritedFromParent</a>"
},
// Method inheritence from non-public superclass.
"<a href=\"../pkg/PublicChild.html#methodInheritedFromParent(int)\">" +
"methodInheritedFromParent</a>"
},
// Field inheritence from non-public superinterface.
"<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" +
"fieldInheritedFromInterface</a>"
},
// Method inheritence from non-public superinterface.
"<a href=\"../pkg/PublicInterface.html#methodInterface(int)\">" +
"methodInterface</a>"
},
// private class does not show up in tree
},
// Method is documented as though it is declared in the inheriting method.
"<pre>public void methodInheritedFromParent(int p1)"
},
//Make sure implemented interfaces from private superclass are inherited
"<dd><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" +
"<dd><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
//Generic interface method test.
"This comment should get copied to the implementing class"},
};
// Should not document that a method overrides method from private class.
"<strong>Overrides:</strong>"},
// Should not document that a method specified by private interface.
"<strong>Specified by:</strong>"},
"<strong>Specified by:</strong>"},
// Should not mention that any documentation was copied.
"Description copied from"},
"Description copied from"},
// Don't extend private classes or interfaces
"PrivateParent"},
"PrivateInterface"},
"PrivateInterface"},
"All Superinterfaces"},
// Make inherited constant are documented correctly.
"PrivateInterface"},
//Do not inherit private interface method with generic parameters.
//This method has been implemented.
};
// Test output when -private flag is used.
// Field inheritence from non-public superclass.
"Fields inherited from class pkg." +
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a>"
},
"<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" +
"fieldInheritedFromParent</a>"
},
// Field inheritence from non-public superinterface.
"Fields inherited from interface pkg." +
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a>"
},
"<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" +
"fieldInheritedFromInterface</a>"
},
// Method inheritence from non-public superclass.
"Methods inherited from class pkg." +
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a>"
},
"<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent(int)\">" +
"methodInheritedFromParent</a>"
},
// Should document that a method overrides method from private class.
"<dt><strong>Overrides:</strong></dt>" + NL +
"<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
"methodOverridenFromParent</a></code> in class <code>" +
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a></code></dd>"},
// Should document that a method is specified by private interface.
"<dt><strong>Specified by:</strong></dt>" + NL +
"<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
"methodInterface</a></code> in interface <code>" +
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a></code></dd>"},
// Method inheritence from non-public superinterface.
"Methods inherited from interface pkg." +
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a>"
},
"<a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
"methodInterface</a>"
},
// Should mention that any documentation was copied.
"Description copied from"},
// Extend documented private classes or interfaces
"extends"},
"extends"},
"All Superinterfaces"},
//Make sure implemented interfaces from private superclass are inherited
"<dd><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a>, " +
"<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild" +
"<dd><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a>, " +
"<a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
//Since private flag is used, we can document that private interface method
//with generic parameters has been implemented.
"<strong>Description copied from interface: <code>" +
"<dt><strong>Specified by:</strong></dt>" + NL +
" in interface <code>" +
"<java.lang.String></code></dd>"},
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
}
/**
* {@inheritDoc}
*/
return BUG_ID;
}
/**
* {@inheritDoc}
*/
}
}