1
是否有方法來指定異常原因的記錄方式?如何爲多種方法記錄javadoc異常原因
我有一堆方法的類,它們都拋出幾乎相同的異常;例如:
/**
* some doc
* @return value
* @throws SpecificException when X happens
*/
public int fn1() throws SpecificException{
return 0;
}
/**
* some different doc
* @return value
* @throws SpecificException when X happens
*/
public int fn2() throws SpecificException{
return 0;
}
我想避免copypasting @throws事物的文檔。
有沒有辦法做到這一點?
不這麼認爲。 – Reinard