329 lines
9.8 KiB
HTML
329 lines
9.8 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<title>Checks for usage</title>
|
|
<link rel="stylesheet" type="text/css" href="mystyle.css"/>
|
|
</head>
|
|
|
|
<body>
|
|
<!-- The header -->
|
|
<table border="0" width="100%" summary="header layout">
|
|
<tr>
|
|
<td><h1>Checks for usage</h1></td>
|
|
<td align="right"><img src="logo.png" alt="Checkstyle Logo"/></td>
|
|
</tr>
|
|
</table>
|
|
<!-- content -->
|
|
<table border="0" width="100%" cellpadding="5" summary="body layout">
|
|
<tr>
|
|
<!--Left menu-->
|
|
<td class="menu" valign="top">
|
|
<ul>
|
|
<li>
|
|
<a href="#OneMethodPrivateField">OneMethodPrivateField</a>
|
|
</li>
|
|
<li>
|
|
<a href="#UnusedLocalVariable">UnusedLocalVariable</a>
|
|
</li>
|
|
<li>
|
|
<a href="#UnusedParameter">UnusedParameter</a>
|
|
</li>
|
|
<li>
|
|
<a href="#UnusedPrivateField">UnusedPrivateField</a>
|
|
</li>
|
|
<li>
|
|
<a href="#UnusedPrivateMethod">UnusedPrivateMethod</a>
|
|
</li>
|
|
</ul>
|
|
</td>
|
|
<!--Content-->
|
|
<td class="content" valign="top" align="left">
|
|
|
|
<a name="OneMethodPrivateField"></a> <h2>OneMethodPrivateField</h2> <h4>Description</h4>
|
|
|
|
<p class="body">
|
|
Checks that a private field is used in more than one method, constructor, or initializer.
|
|
</p>
|
|
<p class="body">
|
|
Rationale: a private field used in only one method, constructor, or
|
|
initializer should be replaced by a local variable.
|
|
</p>
|
|
<h4>Properties</h4>
|
|
<table width="100%" border="1" cellpadding="5" class="body">
|
|
<tr class="header">
|
|
<th>name</th>
|
|
<th>description</th>
|
|
<th>type</th>
|
|
<th>default value</th>
|
|
</tr>
|
|
<tr>
|
|
<td>ignoreFormat</td>
|
|
<td>pattern for field names that should be ignored</td>
|
|
<td><a href="property_types.html#regexp">regular expression</a></td>
|
|
<td><span class="default">^$</span> (empty)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Examples</h4>
|
|
<p class="body">
|
|
To configure the check:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.OneMethodPrivateField"/>
|
|
</pre>
|
|
<p class="body">
|
|
To configure the check to ignore fields whose name ends in <span class="code">Temp</span>:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.OneMethodPrivateField">
|
|
<property name="ignoreFormat" value="Temp$"/>
|
|
</module>
|
|
</pre>
|
|
<h4>Package</h4>
|
|
<p class="body">
|
|
com.puppycrawl.tools.checkstyle.checks.usage
|
|
</p>
|
|
|
|
<h4>Parent Module</h4>
|
|
<p class="body">
|
|
<a href="config.html#treewalker">TreeWalker</a>
|
|
</p>
|
|
|
|
|
|
<a name="UnusedLocalVariable"></a> <h2>UnusedLocalVariable</h2> <h4>Description</h4>
|
|
|
|
<p class="body">
|
|
Checks that a local variable is used after its declaration.
|
|
</p>
|
|
</p>
|
|
<h4>Properties</h4>
|
|
<table width="100%" border="1" cellpadding="5" class="body">
|
|
<tr class="header">
|
|
<th>name</th>
|
|
<th>description</th>
|
|
<th>type</th>
|
|
<th>default value</th>
|
|
</tr>
|
|
<tr>
|
|
<td>ignoreFormat</td>
|
|
<td>pattern for variable names that should be ignored</td>
|
|
<td><a href="property_types.html#regexp">regular expression</a></td>
|
|
<td><span class="default">^$</span> (empty)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Examples</h4>
|
|
<p class="body">
|
|
To configure the check:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedLocalVariable"/>
|
|
</pre>
|
|
<p class="body">
|
|
To configure the check to ignore variables whose name ends in <span class="code">Temp</span>:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedLocalVariable">
|
|
<property name="ignoreFormat" value="Temp$"/>
|
|
</module>
|
|
</pre>
|
|
<h4>Package</h4>
|
|
<p class="body">
|
|
com.puppycrawl.tools.checkstyle.checks.usage
|
|
</p>
|
|
|
|
<h4>Parent Module</h4>
|
|
<p class="body">
|
|
<a href="config.html#treewalker">TreeWalker</a>
|
|
</p>
|
|
|
|
|
|
<a name="UnusedParameter"></a> <h2>UnusedParameter</h2> <h4>Description</h4>
|
|
|
|
<p class="body">
|
|
Checks that a parameter is used.
|
|
</p>
|
|
</p>
|
|
<h4>Properties</h4>
|
|
<table width="100%" border="1" cellpadding="5" class="body">
|
|
<tr class="header">
|
|
<th>name</th>
|
|
<th>description</th>
|
|
<th>type</th>
|
|
<th>default value</th>
|
|
</tr>
|
|
<tr>
|
|
<td>ignoreFormat</td>
|
|
<td>pattern for parameter names that should be ignored</td>
|
|
<td><a href="property_types.html#regexp">regular expression</a></td>
|
|
<td><span class="default">^$</span> (empty)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ignoreCatch</td>
|
|
<td>controls whether <span class="code">catch</span> parameters should be ignored</td>
|
|
<td><a href="property_types.html#boolean">boolean</a></td>
|
|
<td><span class="default">true</span></td>
|
|
</tr>
|
|
<tr>
|
|
<td>ignoreNonLocal</td>
|
|
<td>controls whether parameters of non local (<span
|
|
class="code">public, protected or package</span>) methods
|
|
should be ignored</td>
|
|
<td><a href="property_types.html#boolean">boolean</a></td>
|
|
<td><span class="default">false</span></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Examples</h4>
|
|
<p class="body">
|
|
To configure the check:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedParameter"/>
|
|
</pre>
|
|
<p class="body">
|
|
To configure the check to ignore parameters whose name ends in <span class="code">Temp</span>:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedParameter">
|
|
<property name="ignoreFormat" value="Temp$"/>
|
|
</module>
|
|
</pre>
|
|
<p class="body">
|
|
To configure the check to report unused <span class="code">catch</span> parameters:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedParameter">
|
|
<property name="ignoreCatch" value="false"/>
|
|
</module>
|
|
</pre>
|
|
<h4>Package</h4>
|
|
<p class="body">
|
|
com.puppycrawl.tools.checkstyle.checks.usage
|
|
</p>
|
|
|
|
<h4>Parent Module</h4>
|
|
<p class="body">
|
|
<a href="config.html#treewalker">TreeWalker</a>
|
|
</p>
|
|
|
|
<a name="UnusedPrivateField"></a> <h2>UnusedPrivateField</h2> <h4>Description</h4>
|
|
|
|
<p class="body">
|
|
Checks that a private field is used.
|
|
</p>
|
|
</p>
|
|
<h4>Properties</h4>
|
|
<table width="100%" border="1" cellpadding="5" class="body">
|
|
<tr class="header">
|
|
<th>name</th>
|
|
<th>description</th>
|
|
<th>type</th>
|
|
<th>default value</th>
|
|
</tr>
|
|
<tr>
|
|
<td>ignoreFormat</td>
|
|
<td>pattern for field names that should be ignored</td>
|
|
<td><a href="property_types.html#regexp">regular expression</a></td>
|
|
<td><span class="default">^$</span> (empty)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Examples</h4>
|
|
<p class="body">
|
|
To configure the check:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedPrivateField"/>
|
|
</pre>
|
|
<p class="body">
|
|
To configure the check to ignore fields whose name ends in <span class="code">Temp</span>:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedPrivateField">
|
|
<property name="ignoreFormat" value="Temp$"/>
|
|
</module>
|
|
</pre>
|
|
<h4>Package</h4>
|
|
<p class="body">
|
|
com.puppycrawl.tools.checkstyle.checks.usage
|
|
</p>
|
|
|
|
<h4>Parent Module</h4>
|
|
<p class="body">
|
|
<a href="config.html#treewalker">TreeWalker</a>
|
|
</p>
|
|
|
|
|
|
<a name="UnusedPrivateMethod"></a> <h2>UnusedPrivateMethod</h2> <h4>Description</h4>
|
|
|
|
<p class="body">
|
|
Checks that a private method is used.
|
|
</p>
|
|
</p>
|
|
<h4>Properties</h4>
|
|
<table width="100%" border="1" cellpadding="5" class="body">
|
|
<tr class="header">
|
|
<th>name</th>
|
|
<th>description</th>
|
|
<th>type</th>
|
|
<th>default value</th>
|
|
</tr>
|
|
<tr>
|
|
<td>ignoreFormat</td>
|
|
<td>pattern for method names that should be ignored</td>
|
|
<td><a href="property_types.html#regexp">regular expression</a></td>
|
|
<td><span class="default">^$</span> (empty)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4>Examples</h4>
|
|
<p class="body">
|
|
To configure the check:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedPrivateMethod"/>
|
|
</pre>
|
|
<p class="body">
|
|
To configure the check to ignore methods whose name ends in <span class="code">Temp</span>:
|
|
</p>
|
|
<pre class="body">
|
|
<module name="usage.UnusedPrivateMethod">
|
|
<property name="ignoreFormat" value="Temp$"/>
|
|
</module>
|
|
</pre>
|
|
|
|
<h4>Notes</h4>
|
|
|
|
<ul class="body">
|
|
<li>The classpath may need to be configured to locate parameter type information. The
|
|
classpath configuration is dependent on the mechanism used to invoke Checkstyle.
|
|
</li>
|
|
</ul>
|
|
|
|
<h4>Package</h4>
|
|
<p class="body">
|
|
com.puppycrawl.tools.checkstyle.checks.usage
|
|
</p>
|
|
|
|
<h4>Parent Module</h4>
|
|
<p class="body">
|
|
<a href="config.html#treewalker">TreeWalker</a>
|
|
</p>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr />
|
|
<div><a href="index.html">Back to the Checkstyle Home Page</a></div>
|
|
<p class="copyright">
|
|
Copyright © 2002-2004 Oliver Burn. All rights Reserved.
|
|
</p>
|
|
|
|
</body>
|
|
</html>
|