我正在嘗試爲我的類禁用幾個任意的PMD警告。Eclipse複製註釋@SurpressWarnings for PMD
如何列出幾個要忽略的PMD規則?我無法使用Google查找。
@SuppressWarnings("PMD.OnlyOneReturn")
@SuppressWarnings("PMD.ShortVariable")
public class MyClass {
它爲Eclipse編譯時錯誤:
Duplicate annotation @SurpressWarnings
這是編譯但忽略
@SuppressWarnings("PMD.OnlyOneReturn, PMD.ShortVariable")
這
@SuppressWarnings("PMD.OnlyOneReturn", "PMD.ShortVariable")
結果是
Syntax error on token ,
的Eclipse配置爲接受PMD類型:剛纔在Annotation Type SuppressWarnings
Unsupported @SuppressWarnings ("PMD.DoNotCallSystemExit")
對,我會接受你的答案。謝謝 –