Skip to content

Files

Latest commit

 

History

History
23 lines (16 loc) · 455 Bytes

EmptyTryBlock.md

File metadata and controls

23 lines (16 loc) · 455 Bytes

Pattern: Empty try block

Issue: -

Description

Checks for empty try blocks. Empty try blocks are confusing and serve no purpose.

Here is an example of code that produces a violation:

def someMethod() {
    try {
        // empty
    } catch(SomeException e) {
        e.printStackTrace()
    }
}

Further Reading