Use varargs in a few more places.
MODIFY
src/main/java/org/apache/commons/io/DirectoryWalker.java
src/main/java/org/apache/commons/io/DirectoryWalker.java
@@ -550,7 +550,7 @@ protected void handleDirectoryStart(final File directory, final int depth, final
* @throws IOException if an I/O Error occurs
* @since 2.0
*/
- protected File[] filterDirectoryContents(final File directory, final int depth, final File[] files) throws
+ protected File[] filterDirectoryContents(final File directory, final int depth, final File... files) throws
IOException {
return files;
}

MODIFY
src/main/java/org/apache/commons/io/FileUtils.java
src/main/java/org/apache/commons/io/FileUtils.java
@@ -681,7 +681,7 @@ private static IOFileFilter setUpEffectiveDirFilter(final IOFileFilter dirFilter
* @param extensions an array of extensions. Format: {"java", "xml"}
* @return an array of suffixes. Format: {".java", ".xml"}
*/
- private static String[] toSuffixes(final String[] extensions) {
+ private static String[] toSuffixes(final String... extensions) {
final String[] suffixes = new String[extensions.length];
for (int i = 0; i < extensions.length; i++) {
suffixes[i] = "." + extensions[i];
@@ -924,7 +924,7 @@ static String decodeUrl(final String url) {
* @throws IllegalArgumentException if any file is incorrectly encoded
* @since 1.1
*/
- public static File[] toFiles(final URL[] urls) {
+ public static File[] toFiles(final URL... urls) {
if (urls == null || urls.length == 0) {
return EMPTY_FILE_ARRAY;
}
@@ -953,7 +953,7 @@ static String decodeUrl(final String url) {
* @throws IOException if a file cannot be converted
* @throws NullPointerException if the parameter is null
*/
- public static URL[] toURLs(final File[] files) throws IOException {
+ public static URL[] toURLs(final File... files) throws IOException {
final URL[] urls = new URL[files.length];
for (int i = 0; i < urls.length; i++) {

MODIFY
src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java
src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java
@@ -83,7 +83,7 @@ public NameFileFilter(final String name, final IOCase caseSensitivity) {
* @param names the names to allow, must not be null
* @throws IllegalArgumentException if the names array is null
*/
- public NameFileFilter(final String[] names) {
+ public NameFileFilter(final String... names) {
this(names, null);
}

MODIFY
src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java
src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java
@@ -87,7 +87,7 @@ public PrefixFileFilter(final String prefix, final IOCase caseSensitivity) {
* @param prefixes the prefixes to allow, must not be null
* @throws IllegalArgumentException if the prefix array is null
*/
- public PrefixFileFilter(final String[] prefixes) {
+ public PrefixFileFilter(final String... prefixes) {
this(prefixes, IOCase.SENSITIVE);
}

MODIFY
src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java
src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java
@@ -88,7 +88,7 @@ public SuffixFileFilter(final String suffix, final IOCase caseSensitivity) {
* @param suffixes the suffixes to allow, must not be null
* @throws IllegalArgumentException if the suffix array is null
*/
- public SuffixFileFilter(final String[] suffixes) {
+ public SuffixFileFilter(final String... suffixes) {
this(suffixes, IOCase.SENSITIVE);
}

MODIFY
src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java
src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java
@@ -90,7 +90,7 @@ public WildcardFileFilter(final String wildcard, final IOCase caseSensitivity) {
* @param wildcards the array of wildcards to match
* @throws IllegalArgumentException if the pattern array is null
*/
- public WildcardFileFilter(final String[] wildcards) {
+ public WildcardFileFilter(final String... wildcards) {
this(wildcards, IOCase.SENSITIVE);
}

MODIFY
src/main/java/org/apache/commons/io/filefilter/WildcardFilter.java
src/main/java/org/apache/commons/io/filefilter/WildcardFilter.java
@@ -74,7 +74,7 @@ public WildcardFilter(final String wildcard) {
* @param wildcards the array of wildcards to match
* @throws IllegalArgumentException if the pattern array is null
*/
- public WildcardFilter(final String[] wildcards) {
+ public WildcardFilter(final String... wildcards) {
if (wildcards == null) {
throw new IllegalArgumentException("The wildcard array must not be null");
}

MODIFY
src/main/java/org/apache/commons/io/monitor/FileEntry.java
src/main/java/org/apache/commons/io/monitor/FileEntry.java
@@ -162,7 +162,7 @@ public int getLevel() {
*
* @param children This directory's files, may be null
*/
- public void setChildren(final FileEntry[] children) {
+ public void setChildren(final FileEntry... children) {
this.children = children;
}

Use varargs in a few more places.