mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
28 lines
779 B
HTML
28 lines
779 B
HTML
<html>
|
|
<body>
|
|
Reports methods that accept an arbitrary number of parameters (also known as varargs methods).
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
enum EnumConstants {
|
|
A(null), B, C;
|
|
|
|
EnumConstants(String... ss) {}
|
|
}
|
|
</code></pre>
|
|
<p>A quick-fix is available to replace a variable argument
|
|
parameter with an equivalent array parameter. Relevant arguments in method calls are wrapped in an array initializer expression.
|
|
After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
enum EnumConstants {
|
|
A(null), B(new String[]{}), C(new String[]{});
|
|
|
|
EnumConstants(String[] ss) {}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
<i>Varargs method</i> appeared in Java 5.
|
|
This inspection can help to downgrade for backward compatibility with earlier Java versions.
|
|
</p>
|
|
</body>
|
|
</html> |