记录每个方法抛出的所有异常
这是严重使用不足。大多数公共 API 都没有 @throws Java 文档来解释抛出的异常。
这是一个很好的例子。
...
*
* @throws MalformedURLException The formal system identifier of a
* subordinate catalog cannot be turned into a valid URL.
* @throws IOException Error reading subordinate catalog file.
*/
public String resolveSystem(String systemId)
throws MalformedURLException, IOException {
...这是一个缺乏有关在什么情况下抛出异常的信息的坏例子。
* @throws Exception exception
*/
public void startServer() throws Exception {
if (!externalDatabaseHost) {











