Skip to content

Commit

Permalink
Issue #5832: Add javadoc and xdoc Example for CatchParameterName
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunghanjacktsai authored and rnveach committed Sep 20, 2018
1 parent ecaa420 commit 27512b0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
Expand Up @@ -56,12 +56,31 @@
* An example of how to configure the check for names that begin with a lower case letter,
* followed by any letters or digits is:
* </p>
* <p>Configuration:</p>
* <pre>
* &lt;module name="CatchParameterName"&gt;
* &lt;property name="format" value="^[a-z][a-zA-Z0-9]+$"/&gt;
* &lt;/module&gt;
* </pre>
*
* <p>Example:</p>
* <pre>
* 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
* // ...
* }
* }
* }
* </pre>
* @since 6.14
*/
public class CatchParameterNameCheck extends AbstractNameCheck {
Expand Down
20 changes: 20 additions & 0 deletions src/xdocs/config_naming.xml
Expand Up @@ -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:
</p>
<p>Configuration:</p>
<source>
&lt;module name="CatchParameterName"&gt;
&lt;property name="format" value="^[a-z][a-zA-Z0-9]+$"/&gt;
&lt;/module&gt;
</source>
<p>Example:</p>
<pre>
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
// ...
}
}
}
</pre>
</subsection>

<subsection name="Example of Usage" id="CatchParameterName_Example_of_Usage">
Expand Down

0 comments on commit 27512b0

Please sign in to comment.