This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new 083c584  Remove IOException from the method signatures that no longer 
throw IOException.         This maintains binary compatibility but not source 
compatibility.         - FilenameUtils             directoryContains(String, 
String)         - BoundedReader             BoundedReader(java.io.Reader, int)  
       - IOUtils             lineIterator(java.io.InputStream, Charset)         
    lineIterator(java.io.InputStream, String)             toByteArray(String)   
          toInputSt [...]
083c584 is described below

commit 083c58432d8bb169f350cb8936e59883f7dd448f
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Jul 7 13:35:11 2021 -0400

    Remove IOException from the method signatures that no longer
    throw IOException.
            This maintains binary compatibility but not source
    compatibility.
            - FilenameUtils
                directoryContains(String, String)
            - BoundedReader
                BoundedReader(java.io.Reader, int)
            - IOUtils
                lineIterator(java.io.InputStream, Charset)
                lineIterator(java.io.InputStream, String)
                toByteArray(String)
                toInputStream(CharSequence, String)
                toInputStream(String, String)
                toString(byte[])
                toString(byte[], String)
---
 src/changes/changes.xml                             | 19 +++++++++++++++++++
 .../java/org/apache/commons/io/FilenameUtils.java   |  5 +----
 src/main/java/org/apache/commons/io/IOUtils.java    | 21 +++++++--------------
 .../org/apache/commons/io/input/BoundedReader.java  |  3 +--
 4 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 50ebe49..ced388d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -59,6 +59,25 @@ The <action> type attribute can be add,update,fix,remove.
       <action dev="ggregory" type="fix" due-to="Arturo Bernal">
         Replace construction of FileInputStream and FileOutputStream objects 
with Files NIO APIs. #221.
       </action>
+      <action dev="ggregory" type="fix" due-to="Gary Gregory">
+        Fix IndexOutOfBoundsException in IOExceptionList constructors.
+      </action>
+      <action dev="ggregory" type="fix" due-to="Gary Gregory">
+        Remove IOException from the method signatures that no longer throw 
IOException.
+        This maintains binary compatibility but not source compatibility.
+        - FilenameUtils
+            directoryContains(String, String)
+        - BoundedReader
+            BoundedReader(java.io.Reader, int)
+        - IOUtils
+            lineIterator(java.io.InputStream, Charset)
+            lineIterator(java.io.InputStream, String)
+            toByteArray(String)
+            toInputStream(CharSequence, String)
+            toInputStream(String, String)
+            toString(byte[])
+            toString(byte[], String)
+      </action>
       <!-- ADD -->
       <action dev="ggregory" type="update" due-to="Gary Gregory">
         Add SymbolicLinkFileFilter.
diff --git a/src/main/java/org/apache/commons/io/FilenameUtils.java 
b/src/main/java/org/apache/commons/io/FilenameUtils.java
index 90f79ed..bf39f00 100644
--- a/src/main/java/org/apache/commons/io/FilenameUtils.java
+++ b/src/main/java/org/apache/commons/io/FilenameUtils.java
@@ -17,7 +17,6 @@
 package org.apache.commons.io;
 
 import java.io.File;
-import java.io.IOException;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -533,12 +532,10 @@ public class FilenameUtils {
      * @param canonicalChild
      *            the file to consider as the child.
      * @return true is the candidate leaf is under by the specified composite. 
False otherwise.
-     * @throws IOException Never thrown.
      * @since 2.2
      * @see FileUtils#directoryContains(File, File)
      */
-    public static boolean directoryContains(final String canonicalParent, 
final String canonicalChild)
-            throws IOException {
+    public static boolean directoryContains(final String canonicalParent, 
final String canonicalChild) {
         Objects.requireNonNull(canonicalParent, "canonicalParent");
 
         if (canonicalChild == null) {
diff --git a/src/main/java/org/apache/commons/io/IOUtils.java 
b/src/main/java/org/apache/commons/io/IOUtils.java
index f3addf4..1bfdf69 100644
--- a/src/main/java/org/apache/commons/io/IOUtils.java
+++ b/src/main/java/org/apache/commons/io/IOUtils.java
@@ -1594,10 +1594,9 @@ public class IOUtils {
      * @param charset the charset to use, null means platform default
      * @return an Iterator of the lines in the reader, never null
      * @throws IllegalArgumentException if the input is null
-     * @throws IOException Never thrown.
      * @since 2.3
      */
-    public static LineIterator lineIterator(final InputStream input, final 
Charset charset) throws IOException {
+    public static LineIterator lineIterator(final InputStream input, final 
Charset charset) {
         return new LineIterator(new InputStreamReader(input, 
Charsets.toCharset(charset)));
     }
 
@@ -1628,13 +1627,12 @@ public class IOUtils {
      * @param charsetName the encoding to use, null means platform default
      * @return an Iterator of the lines in the reader, never null
      * @throws IllegalArgumentException                     if the input is 
null
-     * @throws IOException                                  if an I/O error 
occurs, such as if the encoding is invalid
      * @throws java.nio.charset.UnsupportedCharsetException thrown instead of 
{@link java.io
      *                                                      
.UnsupportedEncodingException} in version 2.2 if the
      *                                                      encoding is not 
supported.
      * @since 1.2
      */
-    public static LineIterator lineIterator(final InputStream input, final 
String charsetName) throws IOException {
+    public static LineIterator lineIterator(final InputStream input, final 
String charsetName) {
         return lineIterator(input, Charsets.toCharset(charsetName));
     }
 
@@ -2543,11 +2541,10 @@ public class IOUtils {
      * @param input the {@code String} to convert
      * @return the requested byte array
      * @throws NullPointerException if the input is null
-     * @throws IOException Never thrown.
      * @deprecated 2.5 Use {@link String#getBytes()} instead
      */
     @Deprecated
-    public static byte[] toByteArray(final String input) throws IOException {
+    public static byte[] toByteArray(final String input) {
         // make explicit the use of the default charset
         return input.getBytes(Charset.defaultCharset());
     }
@@ -2717,13 +2714,12 @@ public class IOUtils {
      * @param input the CharSequence to convert
      * @param charsetName the name of the requested charset, null means 
platform default
      * @return an input stream
-     * @throws IOException Never thrown.
      * @throws java.nio.charset.UnsupportedCharsetException thrown instead of 
{@link java.io
      *                                                      
.UnsupportedEncodingException} in version 2.2 if the
      *                                                      encoding is not 
supported.
      * @since 2.0
      */
-    public static InputStream toInputStream(final CharSequence input, final 
String charsetName) throws IOException {
+    public static InputStream toInputStream(final CharSequence input, final 
String charsetName) {
         return toInputStream(input, Charsets.toCharset(charsetName));
     }
 
@@ -2764,13 +2760,12 @@ public class IOUtils {
      * @param input the string to convert
      * @param charsetName the name of the requested charset, null means 
platform default
      * @return an input stream
-     * @throws IOException Never thrown.
      * @throws java.nio.charset.UnsupportedCharsetException thrown instead of 
{@link java.io
      *                                                      
.UnsupportedEncodingException} in version 2.2 if the
      *                                                      encoding is not 
supported.
      * @since 1.1
      */
-    public static InputStream toInputStream(final String input, final String 
charsetName) throws IOException {
+    public static InputStream toInputStream(final String input, final String 
charsetName) {
         final byte[] bytes = input.getBytes(Charsets.toCharset(charsetName));
         return new ByteArrayInputStream(bytes);
     }
@@ -2782,11 +2777,10 @@ public class IOUtils {
      * @param input the byte array to read from
      * @return the requested String
      * @throws NullPointerException if the input is null
-     * @throws IOException Never thrown.
      * @deprecated 2.5 Use {@link String#String(byte[])} instead
      */
     @Deprecated
-    public static String toString(final byte[] input) throws IOException {
+    public static String toString(final byte[] input) {
         // make explicit the use of the default charset
         return new String(input, Charset.defaultCharset());
     }
@@ -2802,9 +2796,8 @@ public class IOUtils {
      * @param charsetName the name of the requested charset, null means 
platform default
      * @return the requested String
      * @throws NullPointerException if the input is null
-     * @throws IOException Never thrown.
      */
-    public static String toString(final byte[] input, final String 
charsetName) throws IOException {
+    public static String toString(final byte[] input, final String 
charsetName) {
         return new String(input, Charsets.toCharset(charsetName));
     }
 
diff --git a/src/main/java/org/apache/commons/io/input/BoundedReader.java 
b/src/main/java/org/apache/commons/io/input/BoundedReader.java
index 3b3cde2..00e9736 100644
--- a/src/main/java/org/apache/commons/io/input/BoundedReader.java
+++ b/src/main/java/org/apache/commons/io/input/BoundedReader.java
@@ -53,9 +53,8 @@ public class BoundedReader extends Reader {
      *
      * @param target                   The target stream that will be used
      * @param maxCharsFromTargetReader The maximum number of characters that 
can be read from target
-     * @throws IOException Never thrown.
      */
-    public BoundedReader(final Reader target, final int 
maxCharsFromTargetReader) throws IOException {
+    public BoundedReader(final Reader target, final int 
maxCharsFromTargetReader) {
         this.target = target;
         this.maxCharsFromTargetReader = maxCharsFromTargetReader;
     }

Reply via email to