Skip to content

Commit 8940848

Browse files
author
Gary Gregory
committed
Use varargs in a few more places.
1 parent 2539fc9 commit 8940848

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/main/java/org/apache/commons/io/DirectoryWalker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ protected void handleDirectoryStart(final File directory, final int depth, final
550550
* @throws IOException if an I/O Error occurs
551551
* @since 2.0
552552
*/
553-
protected File[] filterDirectoryContents(final File directory, final int depth, final File[] files) throws
553+
protected File[] filterDirectoryContents(final File directory, final int depth, final File... files) throws
554554
IOException {
555555
return files;
556556
}

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ public static Iterator<File> iterateFilesAndDirs(final File directory, final IOF
681681
* @param extensions an array of extensions. Format: {"java", "xml"}
682682
* @return an array of suffixes. Format: {".java", ".xml"}
683683
*/
684-
private static String[] toSuffixes(final String[] extensions) {
684+
private static String[] toSuffixes(final String... extensions) {
685685
final String[] suffixes = new String[extensions.length];
686686
for (int i = 0; i < extensions.length; i++) {
687687
suffixes[i] = "." + extensions[i];
@@ -924,7 +924,7 @@ static String decodeUrl(final String url) {
924924
* @throws IllegalArgumentException if any file is incorrectly encoded
925925
* @since 1.1
926926
*/
927-
public static File[] toFiles(final URL[] urls) {
927+
public static File[] toFiles(final URL... urls) {
928928
if (urls == null || urls.length == 0) {
929929
return EMPTY_FILE_ARRAY;
930930
}
@@ -953,7 +953,7 @@ public static File[] toFiles(final URL[] urls) {
953953
* @throws IOException if a file cannot be converted
954954
* @throws NullPointerException if the parameter is null
955955
*/
956-
public static URL[] toURLs(final File[] files) throws IOException {
956+
public static URL[] toURLs(final File... files) throws IOException {
957957
final URL[] urls = new URL[files.length];
958958

959959
for (int i = 0; i < urls.length; i++) {

src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public NameFileFilter(final String name, final IOCase caseSensitivity) {
8383
* @param names the names to allow, must not be null
8484
* @throws IllegalArgumentException if the names array is null
8585
*/
86-
public NameFileFilter(final String[] names) {
86+
public NameFileFilter(final String... names) {
8787
this(names, null);
8888
}
8989

src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public PrefixFileFilter(final String prefix, final IOCase caseSensitivity) {
8787
* @param prefixes the prefixes to allow, must not be null
8888
* @throws IllegalArgumentException if the prefix array is null
8989
*/
90-
public PrefixFileFilter(final String[] prefixes) {
90+
public PrefixFileFilter(final String... prefixes) {
9191
this(prefixes, IOCase.SENSITIVE);
9292
}
9393

src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public SuffixFileFilter(final String suffix, final IOCase caseSensitivity) {
8888
* @param suffixes the suffixes to allow, must not be null
8989
* @throws IllegalArgumentException if the suffix array is null
9090
*/
91-
public SuffixFileFilter(final String[] suffixes) {
91+
public SuffixFileFilter(final String... suffixes) {
9292
this(suffixes, IOCase.SENSITIVE);
9393
}
9494

src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public WildcardFileFilter(final String wildcard, final IOCase caseSensitivity) {
9090
* @param wildcards the array of wildcards to match
9191
* @throws IllegalArgumentException if the pattern array is null
9292
*/
93-
public WildcardFileFilter(final String[] wildcards) {
93+
public WildcardFileFilter(final String... wildcards) {
9494
this(wildcards, IOCase.SENSITIVE);
9595
}
9696

src/main/java/org/apache/commons/io/filefilter/WildcardFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public WildcardFilter(final String wildcard) {
7474
* @param wildcards the array of wildcards to match
7575
* @throws IllegalArgumentException if the pattern array is null
7676
*/
77-
public WildcardFilter(final String[] wildcards) {
77+
public WildcardFilter(final String... wildcards) {
7878
if (wildcards == null) {
7979
throw new IllegalArgumentException("The wildcard array must not be null");
8080
}

src/main/java/org/apache/commons/io/monitor/FileEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public FileEntry[] getChildren() {
162162
*
163163
* @param children This directory's files, may be null
164164
*/
165-
public void setChildren(final FileEntry[] children) {
165+
public void setChildren(final FileEntry... children) {
166166
this.children = children;
167167
}
168168

0 commit comments

Comments
 (0)