From 27512b0acc3ad3cb4e28306d4f8936b9108c5bca Mon Sep 17 00:00:00 2001
From: jack870131
Configuration:
** <module name="CatchParameterName"> * <property name="format" value="^[a-z][a-zA-Z0-9]+$"/> * </module> *- * + *
Example:
+ *+ * public class MyTest { + * public void myTest() { + * try { + * // ... + * } catch (ArithmeticException ex) { //OK + * // ... + * } catch (ArrayIndexOutOfBoundsException ex2) { //OK + * // ... + * } catch (IOException thirdException) { //OK + * // ... + * } catch (Exception FourthException) { // violation, the initial letter + * // should be lowercase + * // ... + * } + * } + * } + ** @since 6.14 */ public class CatchParameterNameCheck extends AbstractNameCheck { diff --git a/src/xdocs/config_naming.xml b/src/xdocs/config_naming.xml index ec6ea1ced..71bd1edbb 100644 --- a/src/xdocs/config_naming.xml +++ b/src/xdocs/config_naming.xml @@ -376,11 +376,31 @@ class AbstractThirdClass {} // OK, no "abstract" modifier An example of how to configure the check for names that begin with a lower case letter, followed by any letters or digits is: +
Configuration:
+Example:
++public class MyTest { + public void myTest() { + try { + // ... + } catch (ArithmeticException ex) { //OK + // ... + } catch (ArrayIndexOutOfBoundsException ex2) { //OK + // ... + } catch (IOException thirdException) { //OK + // ... + } catch (Exception FourthException) { // violation, the initial letter + // should be lowercase + // ... + } + } +} +