You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/11 05:52:58 UTC

[commons-io] branch master updated (2c8664b -> 09bda53)

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

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


    from 2c8664b  Fix curlies formatting and format to 120 wide lines.
     new 3cd15b6  Typo in exception message.
     new 09bda53  Add unchecked exception to a method signature and Javadoc, preserves BC since it is unchecked.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/java/org/apache/commons/io/Charsets.java | 11 +++++------
 src/main/java/org/apache/commons/io/IOUtils.java  |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)


[commons-io] 01/02: Typo in exception message.

Posted by gg...@apache.org.
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

commit 3cd15b6ebe43e8f0fcc9b24f42d655d7f1c1e2b2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jan 11 00:52:08 2021 -0500

    Typo in exception message.
---
 src/main/java/org/apache/commons/io/IOUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/io/IOUtils.java b/src/main/java/org/apache/commons/io/IOUtils.java
index f0294c8..4335885 100644
--- a/src/main/java/org/apache/commons/io/IOUtils.java
+++ b/src/main/java/org/apache/commons/io/IOUtils.java
@@ -2286,7 +2286,7 @@ public class IOUtils {
         }
 
         if (offset != size) {
-            throw new IOException("Unexpected read size. current: " + offset + ", expected: " + size);
+            throw new IOException("Unexpected read size, current: " + offset + ", expected: " + size);
         }
 
         return data;


[commons-io] 02/02: Add unchecked exception to a method signature and Javadoc, preserves BC since it is unchecked.

Posted by gg...@apache.org.
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

commit 09bda53aed9728ccb235fa7622e981e47cd943a0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jan 11 00:52:53 2021 -0500

    Add unchecked exception to a method signature and Javadoc, preserves BC
    since it is unchecked.
---
 src/main/java/org/apache/commons/io/Charsets.java | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/Charsets.java b/src/main/java/org/apache/commons/io/Charsets.java
index ecd408b..12c6b8c 100644
--- a/src/main/java/org/apache/commons/io/Charsets.java
+++ b/src/main/java/org/apache/commons/io/Charsets.java
@@ -18,6 +18,7 @@ package org.apache.commons.io;
 
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
+import java.nio.charset.UnsupportedCharsetException;
 import java.util.Collections;
 import java.util.SortedMap;
 import java.util.TreeMap;
@@ -102,13 +103,11 @@ public class Charsets {
     /**
      * Returns a Charset for the named charset. If the name is null, return the default Charset.
      *
-     * @param charsetName
-     *            The name of the requested charset, may be null.
-     * @return a Charset for the named charset
-     * @throws java.nio.charset.UnsupportedCharsetException
-     *             If the named charset is unavailable
+     * @param charsetName The name of the requested charset, may be null.
+     * @return a Charset for the named charset.
+     * @throws UnsupportedCharsetException If the named charset is unavailable (unchecked exception).
      */
-    public static Charset toCharset(final String charsetName) {
+    public static Charset toCharset(final String charsetName) throws UnsupportedCharsetException {
         return charsetName == null ? Charset.defaultCharset() : Charset.forName(charsetName);
     }