-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
qulice-checkstyle/src/test/resources/com/qulice/checkstyle/CatchParameterNames.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Hello. | ||
*/ | ||
package foo; | ||
|
||
import java.io.IOException; | ||
import java.util.concurrent.TimeoutException; | ||
|
||
/** | ||
* Simple. | ||
* @author John Smith (john@example.com) | ||
* @version $Id$ | ||
* @since 1.0 | ||
* @checkstyle HiddenField (100 lines) | ||
*/ | ||
public final class CatchParameterNames { | ||
/** | ||
* Dummy variable. | ||
*/ | ||
private int var; | ||
/** | ||
* Invalid exception parameter name. | ||
*/ | ||
void invalidOne() { | ||
try { | ||
this.var += 1; | ||
} catch (final IOException ex_invalid_1) { | ||
this.var -= 1; | ||
} catch (final IllegalArgumentException $xxx) { | ||
this.var -= 1; | ||
} catch (final TimeoutException _exp) { | ||
this.var -= 1; | ||
} | ||
} | ||
|
||
/** | ||
* Valid exception parameter name. | ||
*/ | ||
void validOne() { | ||
try { | ||
this.var += 1; | ||
} catch (final IOException ex) { | ||
this.var -= 1; | ||
} catch (final IllegalArgumentException exp) { | ||
this.var -= 1; | ||
} | ||
} | ||
|
||
} |