mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
24 lines
681 B
HTML
24 lines
681 B
HTML
<html>
|
|
<body>
|
|
Reports pattern variables named identically to a field of a surrounding class.
|
|
As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended.
|
|
<p>
|
|
A quick-fix is suggested to rename the variable.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
class Pointless {
|
|
Point p = new Point();
|
|
|
|
public void test(Object a) {
|
|
if (a instanceof Point p) {
|
|
System.out.print("a is a point (" + p.x + ", " + p.y + ')');
|
|
} else {
|
|
System.out.print("p is a point (" + p.x + ", " + p.y + ')');
|
|
}
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p><small>New in 2022.2</small></p>
|
|
</body>
|
|
</html> |