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 2020/09/23 14:13:46 UTC

[commons-vfs] 02/03: Remove URISyntaxException from private method. This commits simply changes the private method signature but not the public one in this class for source compatibility, which lets the compiler tell us that other methods now uselessly throw URISyntaxException.

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-vfs.git

commit 676451b7faffa65dcabe15beb5ebb154244f8c58
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Sep 23 10:00:16 2020 -0400

    Remove URISyntaxException from private method. This commits simply
    changes the private method signature but not the public one in this
    class for source compatibility, which lets the compiler tell us that
    other methods now uselessly throw URISyntaxException.
---
 .../src/main/java/org/apache/commons/vfs2/util/URIUtils.java        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java
index 8b05bf6..bb3b528 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIUtils.java
@@ -183,7 +183,7 @@ public class URIUtils {
      */
     private static final String DEFAULT_PROTOCOL_CHARSET = "UTF-8";
 
-    private static String encode(final String unescaped, final BitSet allowed, final String charset) throws URISyntaxException {
+    private static String encode(final String unescaped, final BitSet allowed, final String charset) {
         final byte[] rawdata = URLCodecUtils.encodeUrl(allowed, EncodingUtils.getBytes(unescaped, charset));
         return EncodingUtils.getAsciiString(rawdata, 0, rawdata.length);
     }
@@ -195,7 +195,7 @@ public class URIUtils {
      * @param unescaped an unescaped string
      * @return the escaped string
      *
-     * @throws URISyntaxException if the default protocol charset is not supported
+     * @throws URISyntaxException not thrown but kept for source compatibility
      */
     public static String encodePath(final String unescaped) throws URISyntaxException {
         return encodePath(unescaped, DEFAULT_PROTOCOL_CHARSET);
@@ -209,7 +209,7 @@ public class URIUtils {
      * @param charset the charset
      * @return the escaped string
      *
-     * @throws URISyntaxException if the charset is not supported
+     * @throws URISyntaxException not thrown but kept for source compatibility
      */
     public static String encodePath(final String unescaped, final String charset) throws URISyntaxException {
         if (unescaped == null) {