AutoRefactor icon indicating copy to clipboard operation
AutoRefactor copied to clipboard

New refactoring - Remove declared exceptions that are covered my a more generic declared exception

Open JnRouvignac opened this issue 11 years ago • 1 comments

Given

/**
 * Does something.
 * @throws IOException if something bad happens
 * @throws FileNotFoundException if something bad happens
 */
public void doSomething() throws IOException, FileNotFoundException {
    // Call some methods that can throw IOException and FileNotFoundException
}

When

automatic refactorings are applied

Then

code should become:

/**
 * Does something.
 * @throws IOException if something bad happens
 */
public void doSomething() throws IOException, FileNotFoundException {
    // Call some methods that can throw IOException and FileNotFoundException
}

JnRouvignac avatar Dec 23 '13 14:12 JnRouvignac

Maybe have a look at RemoveUncheckedThrowsClausesRefactoring for a head start.

JnRouvignac avatar Dec 23 '17 00:12 JnRouvignac