diff --git a/docs/config_usage.html b/docs/config_usage.html new file mode 100644 index 000000000..a0f5bb2a5 --- /dev/null +++ b/docs/config_usage.html @@ -0,0 +1,311 @@ + + + + + Checks for usage + + + + + + + + + + +

Checks for usage

Checkstyle Logo
+ + + + + + + + +
+ +

OneMethodPrivateField

Description

+ +

+ Checks that a private field is used in more than one method, constructor, or initializer. +

+

+ Rationale: a private field used in only one method, constructor, or + initializer should be replaced by a local variable. +

+

Properties

+ + + + + + + + + + + + + +
namedescriptiontypedefault value
ignoreFormatpattern for field names that should be ignoredregular expression^$ (empty)
+ +

Examples

+

+ To configure the check: +

+
+<module name="OneMethodPrivateField"/>
+      
+

+ To configure the check to ignore fields whose name ends in Temp: +

+
+<module name="OneMethodPrivateField">
+    <property name="ignoreFormat" value="Temp$"/>
+</module>
+      
+

Package

+

+ com.puppycrawl.tools.checkstyle.checks.usage +

+ +

Parent Module

+

+ TreeWalker +

+ + +

UnusedLocalVariable

Description

+ +

+ Checks that a local variable is used after its declaration. +

+

+

Properties

+ + + + + + + + + + + + + +
namedescriptiontypedefault value
ignoreFormatpattern for variable names that should be ignoredregular expression^$ (empty)
+ +

Examples

+

+ To configure the check: +

+
+<module name="UnusedLocalVariable"/>
+      
+

+ To configure the check to ignore variables whose name ends in Temp: +

+
+<module name="UnusedLocalVariable">
+    <property name="ignoreFormat" value="Temp$"/>
+</module>
+      
+

Package

+

+ com.puppycrawl.tools.checkstyle.checks.usage +

+ +

Parent Module

+

+ TreeWalker +

+ + +

UnusedParameter

Description

+ +

+ Checks that a parameter is used. +

+

+

Properties

+ + + + + + + + + + + + + + + + + + + +
namedescriptiontypedefault value
ignoreFormatpattern for parameter names that should be ignoredregular expression^$ (empty)
ignoreCatchcontrols whether catch parameters should be ignoredbooleantrue
+ +

Examples

+

+ To configure the check: +

+
+<module name="UnusedParameter"/>
+      
+

+ To configure the check to ignore parameters whose name ends in Temp: +

+
+<module name="UnusedParameter">
+    <property name="ignoreFormat" value="Temp$"/>
+</module>
+      
+

+ To configure the check to report unused catch parameters: +

+
+<module name="UnusedParameter">
+    <property name="ignoreCatch" value="false"/>
+</module>
+      
+

Package

+

+ com.puppycrawl.tools.checkstyle.checks.usage +

+ +

Parent Module

+

+ TreeWalker +

+ +

UnusedPrivateField

Description

+ +

+ Checks that a private field is used. +

+

+

Properties

+ + + + + + + + + + + + + +
namedescriptiontypedefault value
ignoreFormatpattern for field names that should be ignoredregular expression^$ (empty)
+ +

Examples

+

+ To configure the check: +

+
+<module name="UnusedPrivateField"/>
+      
+

+ To configure the check to ignore fields whose name ends in Temp: +

+
+<module name="UnusedPrivateField">
+    <property name="ignoreFormat" value="Temp$"/>
+</module>
+      
+

Package

+

+ com.puppycrawl.tools.checkstyle.checks.usage +

+ +

Parent Module

+

+ TreeWalker +

+ + +

UnusedPrivateMethod

Description

+ +

+ Checks that a private method is used. +

+

+

Properties

+ + + + + + + + + + + + + +
namedescriptiontypedefault value
ignoreFormatpattern for method names that should be ignoredregular expression^$ (empty)
+ +

Examples

+

+ To configure the check: +

+
+<module name="UnusedPrivateMethod"/>
+      
+

+ To configure the check to ignore methods whose name ends in Temp: +

+
+<module name="UnusedPrivateMethod">
+    <property name="ignoreFormat" value="Temp$"/>
+</module>
+      
+

Package

+

+ com.puppycrawl.tools.checkstyle.checks.usage +

+ +

Parent Module

+

+ TreeWalker +

+ +
+ +
+
Back to the Checkstyle Home Page
+ + + + diff --git a/docs/index.html b/docs/index.html index 35bd0bce7..e2d38ebe5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -129,6 +129,7 @@
  • Blocks
  • Coding Problems
  • Class Design
  • +
  • Usage
  • J2EE Requirements
  • Miscellaneous Checks
  • diff --git a/docs/releasenotes.html b/docs/releasenotes.html index 422a56477..9e199aef6 100644 --- a/docs/releasenotes.html +++ b/docs/releasenotes.html @@ -115,6 +115,9 @@
  • Added a check that an overriding finalize() method invokes super.finalize().
  • +
  • Added usage checks OneMethodPrivateFieldCheck, UnusedLocalVariableCheck, + UnusedParameterCheck, UnusedPrivateFieldCheck, UnusedPrivateMethodCheck.
  • +