Polish Collection.toArray

Consistently use `StringUtils.toStringArray`, `ClassUtils.toClassArray`
or zero length when converting collections to arrays.

Fixes gh-12160
This commit is contained in:
Phillip Webb
2018-02-22 21:10:02 -08:00
parent 358adcd6e3
commit 4b9c3c137e
84 changed files with 210 additions and 189 deletions

View File

@@ -123,7 +123,7 @@ public class TestJarFile {
public File getFile(String extension) throws IOException {
File file = this.temporaryFolder.newFile();
file = new File(file.getParent(), file.getName() + "." + extension);
ZipUtil.pack(this.entries.toArray(new ZipEntrySource[this.entries.size()]), file);
ZipUtil.pack(this.entries.toArray(new ZipEntrySource[0]), file);
return file;
}