Skip to content

Commit 5e62d0e

Browse files
committed
IO-334 FileUtils.toURLs throws NPE for null parameter
Documented the behaviour git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1347799 13f79535-47bb-0310-9956-ffa450edef68
1 parent a4d1877 commit 5e62d0e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ The <action> type attribute can be add,update,fix,remove.
4747
<body>
4848
<!-- The release date is the date RC is cut -->
4949
<release version="2.4" date="2012-TDB-TDB" description="">
50+
<action issue="IO-334" dev="sebb" type="fix">
51+
FileUtils.toURLs throws NPE for null parameter.
52+
Documented the behaviour.
53+
</action>
5054
<action issue="IO-333" dev="ggregory" type="add" due-to="fmeschbe">
5155
Export OSGi packages at version 1.x in addition to 2.x.
5256
</action>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,9 +936,10 @@ public static File[] toFiles(URL[] urls) {
936936
* <p>
937937
* Returns an array of the same size as the input.
938938
*
939-
* @param files the files to convert
939+
* @param files the files to convert, must not be {@code null}
940940
* @return an array of URLs matching the input
941941
* @throws IOException if a file cannot be converted
942+
* @throws NullPointerException if the parameter is null
942943
*/
943944
public static URL[] toURLs(File[] files) throws IOException {
944945
URL[] urls = new URL[files.length];

0 commit comments

Comments
 (0)