aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming
diff options
context:
space:
mode:
authorMichal Kordas <kordas.michal@gmail.com>2015-11-17 23:38:59 +0100
committerRoman Ivanov <ivanov-jr@mail.ru>2015-12-03 15:16:44 -0800
commitd67d10e9f2b480f7f56fe7cda2a908cd5fe770c7 (patch)
tree5dba940926dba715b51202e5105bc2a08d5447f2 /src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming
parente9e8d2f0a76601762e59f4743f0df0c792bea44d (diff)
downloadcheckstyle-d67d10e9f2b480f7f56fe7cda2a908cd5fe770c7.tar.gz
Issue #2616: Add CatchParameterName check for catch blocks parameters
Diffstat (limited to 'src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming')
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchParameterName.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchParameterName.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchParameterName.java
new file mode 100644
index 000000000..fecd4b491
--- /dev/null
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchParameterName.java
@@ -0,0 +1,50 @@
+package com.puppycrawl.tools.checkstyle.checks.naming;
+
+public class InputCatchParameterName {
+ {
+ try {
+ } catch (Exception e) {
+ }
+ try {
+ } catch (Exception ex) {
+ }
+ try {
+ } catch (Error | Exception err) {
+ }
+ try {
+ } catch (Exception exception) {
+ }
+ try {
+ } catch (Exception exception1) {
+ }
+ try {
+ } catch (Exception noWorries) {
+ }
+ try {
+ } catch (Throwable t) {
+ }
+ try {
+ throw new InterruptedException("interruptedException");
+ } catch (InterruptedException ie) { // violation with default config
+ }
+ try {
+ } catch (Exception iException) { // violation with default config
+ }
+ try {
+ } catch (Exception ok) {
+ // appropriate to take no action here
+ }
+ try {
+ } catch (Exception e1) {
+ try {
+ } catch (Exception e2) {
+ }
+ }
+ try {
+ } catch (Throwable t1) {
+ try {
+ } catch (Throwable t2) {
+ }
+ }
+ }
+}