Files
openide/java/java-impl/resources/inspectionDescriptions/PatternVariableCanBeUsed.html
2025-02-05 04:43:28 +00:00

20 lines
466 B
HTML

<html>
<body>
Reports local variable declarations that can be replaced with pattern variables, which are usually more compact.
<p><b>Example:</b></p>
<pre><code>
if (obj instanceof String) {
String str = (String) obj;
System.out.println(str);
}
</code></pre>
<p>Can be replaced with:</p>
<pre><code>
if (obj instanceof String str) {
System.out.println(str);
}
</code></pre>
<!-- tooltip end -->
<p><small>New in 2020.1</small></p>
</body>
</html>