Various inspections (empty block/statement, empty catch block, redundant interface modifiers, modified parameter).
This plugin uses non-published IDEA API.
Downloads, Bugs, RFEs:
http://sourceforge.net/projects/tz-ip/
- Copy the jar file (e.g. InspectThis.jar) to the plugins directory ($IDEA_HOME/plugins).
- Restart IDEA.
Screenshot: http://www.intellij.org/twiki/pub/Main/InspectThisPlugin/EmptyCatchBlock.jpg
Effective Java by Joshua Bloch ( http://java.sun.com/docs/books/effective/toc.html ). Item 47: Don't ignore exceptions.
http://www.intellij.net/tracker/idea/viewSCR?publicId=9286 ("New inspection: look for 'swallowed' exceptions")
http://www.intellij.net/tracker/idea/viewSCR?publicId=12189 ('"Yellow line" warning on empty catch clause')
There's no fix for this inspection. Possible manual fixes:
- Add comment.
- Throw some exception.
- Log the exception.
- Remove the catch block.
Screenshot: http://www.intellij.org/twiki/pub/Main/InspectThisPlugin/RedundantInterfaceModifier.jpg
JLS, "Chapter 9. Interfaces" ( http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html )
http://www.intellij.net/tracker/idea/viewSCR?publicId=7573 ("Redundant modifier warnings in interfaces")
The fix removes the modifiers.
Screenshot: http://www.intellij.org/twiki/pub/Main/InspectThisPlugin/ModifiedParameter.jpg
http://www.intellij.net/tracker/idea/viewSCR?publicId=7738 ("Warnings for modified parameters")
There's no fix for this inspection.
Screenshots:
http://www.intellij.org/twiki/pub/Main/InspectThisPlugin/EmptyBlock.jpg
http://www.intellij.org/twiki/pub/Main/InspectThisPlugin/RedundantSemicolons.jpg
Empty blocks: then, else, finally, code block, try, synchronized, switch, static initializer, instance initializer.
Also checks for empty statements and redundant semicolons ("; class A {;};").
Exceptions: loop (for, while, do while), if-else.
Fix available only for empty statements and redundant semicolons.
- Specify the location of $idea.home in build.properties
- ant clean main.
- RFE [ 759547 ] Checking for empty statements.
- RFE [ 759608 ] Checking for redundant semicolons ("; class A {;};").
- Bug [ 758833 ] Misses some empty catch blocks: {}.
- RFE [ 758983 ] Modified parameter inspection.
- RFE [ 759313 ] Empty block inspection (then, else, finally, etc).
- RFE [ 758813 ] Redundant interface modifiers.
- RFE [ 758690 ] Empty catch block.
-- TimurZambalayev - Jun 22, 2003
|
|