Files
openide/java/java-impl/resources/inspectionDescriptions/SuspiciousNameCombination.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

23 lines
1.1 KiB
HTML

<html>
<body>
Reports assignments and function calls in which the name of the target variable or the function parameter does not match the name of the value assigned to it.
<p>Example 1:</p>
<pre><code>
<b>int</b> x = 0;
<b>int</b> y = x; // x is used as a y-coordinate
</code></pre>
<p>Example 2:</p>
<pre><code>
<b>int</b> x = 0, y = 0;
// x is used as a y-coordinate and y as an x-coordinate
Rectangle rc = <b>new</b> Rectangle(y, x, 20, 20);
</code></pre>
<!-- tooltip end -->
<p>Configure the inspection:</p>
<p>Use the <b>Group of names</b> area to specify the names which should not be used together: an error is reported
if the parameter name or assignment target name contains words from one group and the name of the assigned or passed
variable contains words from a different group.
<p>Use the <b>Ignore methods</b> area to specify the methods that should not be checked but have a potentially suspicious name.
For example, the <code>Integer.compare()</code> parameters are named <code>x</code> and <code>y</code> but are unrelated to coordinates.
</body>
</html>