Detecting redundant throws clauses in public methods

I was wondering if now in Maia, now that IntelliJ can detect when a method is never called, can it also detect when it's never extended and so can detect when a throws clause is redundant in a method, e.g.

public void doNothing throws SQLException {
     //do nothing
}

I've tested this out and IntelliJ doesn't complain about the SQLException unless I make the method static, private or final or the class final.  I think it would be a good improvement to have.

1 comment
Comment actions Permalink

Hello Adam,

There is only a global inspection for this now.

Thank you
-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

I was wondering if now in Maia, now that IntelliJ can detect when a
method is never called, can it also detect when it's never extended
and so can detect when a throws clause is redundant in a method, e.g.

public void doNothing throws SQLException {
//do nothing
}
I've tested this out and IntelliJ doesn't complain about the
SQLException unless I make the method static, private or final or the
class final. I think it would be a good improvement to have.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5241139#5241139



0

Please sign in to leave a comment.