diff options
author | Andrei Selkin <andreyselkin@gmail.com> | 2015-11-05 23:33:42 +0300 |
---|---|---|
committer | Roman Ivanov <ivanov-jr@mail.ru> | 2015-11-05 20:59:34 -0800 |
commit | 176301250bfd2063f405fed4a960064e0a3e0230 (patch) | |
tree | 6aae24659d402513d993792b4da3baa52a98cc29 /src/test/resources | |
parent | 8381754587bee0de49489e9bfb11e5912f664e87 (diff) | |
download | checkstyle-176301250bfd2063f405fed4a960064e0a3e0230.tar.gz |
Issue #2290: Add 'skipCatchParameter' to skip catch parameter from validation
Diffstat (limited to 'src/test/resources')
3 files changed, 77 insertions, 2 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchParameter.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchParameter.java new file mode 100644 index 000000000..47388bef2 --- /dev/null +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchParameter.java @@ -0,0 +1,27 @@ +package com.puppycrawl.tools.checkstyle.checks.naming; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.SQLException; + +public class InputCatchParameter { + + void foo1() { + try { + + } + catch (Exception ex) { + + } + } + + void foo2() { + try { + + } + catch (NullPointerException | IllegalArgumentException ex) { + // just to check how the ParentName's option 'skipCahcthParameter' deals with catching + // multiple exception types and + } + } +} diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputOverrideAnnotation.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputOverrideAnnotation.java index e4e40d126..608b3a5c1 100644 --- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputOverrideAnnotation.java +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputOverrideAnnotation.java @@ -26,6 +26,4 @@ public class InputOverrideAnnotation { InputOverrideAnnotation() {} // No NPE here! InputOverrideAnnotation(int field, java.util.Set<String> packageNames) {} // No NPE here! - - } diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputParameterNameMultipleOptions.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputParameterNameMultipleOptions.java new file mode 100644 index 000000000..f42bd2125 --- /dev/null +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputParameterNameMultipleOptions.java @@ -0,0 +1,50 @@ +package com.puppycrawl.tools.checkstyle.checks.naming; + +import java.util.Set; + +public class InputParameterNameMultipleOptions { + + @Override + public boolean equals(Object o) { + return super.equals(o); + } + + @SuppressWarnings("") + public void foo1(Object object) { + + } + + public void foo2(Integer aaaa) {} + + void foo3() {} // No NPE here! + + void foo4(int abc, int bd) {} // No NPE here! + + int foo5(int abc) {return 1;} // No NPE here! + + private int field; + private Set<String> packageNames; + + InputParameterNameMultipleOptions() {} // No NPE here! + + InputParameterNameMultipleOptions(int field, Set<String> packageNames) {} // No NPE here! + + void foo6() { + try { + + } + catch (Exception ex) { + + } + } + + void foo7() { + try { + + } + catch (NullPointerException | IllegalArgumentException ex) { + // just to check how the ParentName's option 'skipCahcthParameter' deals with catching + // multiple exception types and + } + } +} |