我得到一個編譯器在Eclipse爲@SuppressWarnings
標註警告的代碼:不必要的@SuppressWarnings(「未使用」)
@Override
public boolean doSomething(@SuppressWarnings("unused") String whatever) throws AnException {
throw new AnException("I'm still in bed and can't do anything until I've had a shower!");
}
它看起來像字下一個黃色的波浪線「未使用」和鼠標懸停我得到工具提示Unnecessary @SuppressWarnings("unused")
。
我認爲另一個開發人員會被提示通過eclipse添加這些註釋,而我基本上被提示將它們取出。我如何配置eclipse來提示我將@SuppressWarnings
註解放入其中而不是抱怨呢?
如果有人想對這裏的最佳實踐發表評論,那麼這也是最受歡迎的。
這真的取決於您是否喜歡在代碼中看到流暢的線條。它讓我發瘋。 – Jivings 2012-03-02 10:27:07