FAQ
Repository: ant
Updated Branches:
   refs/heads/1.9.x deaa7d54a -> 82b2e47ba


remove unused throws clauses

https://bz.apache.org/bugzilla/attachment.cgi?id=33898

Patch-by: Dave Brosius <dbrosius@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/82b2e47b
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/82b2e47b
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/82b2e47b

Branch: refs/heads/1.9.x
Commit: 82b2e47ba8774acf2ee97cc4c230c680223cd981
Parents: deaa7d5
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Fri May 27 15:56:11 2016 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Fri May 27 15:56:11 2016 +0200

----------------------------------------------------------------------
  src/main/org/apache/tools/ant/AntClassLoader.java | 5 +----
  src/main/org/apache/tools/ant/taskdefs/Concat.java | 2 +-
  src/main/org/apache/tools/ant/taskdefs/Jar.java | 3 +--
  src/main/org/apache/tools/ant/taskdefs/Zip.java | 3 +--
  .../org/apache/tools/ant/taskdefs/optional/unix/Symlink.java | 4 +---
  src/main/org/apache/tools/ant/util/UUEncoder.java | 2 +-
  6 files changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/AntClassLoader.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/AntClassLoader.java b/src/main/org/apache/tools/ant/AntClassLoader.java
index 129b004..96b92fc 100644
--- a/src/main/org/apache/tools/ant/AntClassLoader.java
+++ b/src/main/org/apache/tools/ant/AntClassLoader.java
@@ -1210,11 +1210,8 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener, Clo
       *
       * @return the entry's certificates or null is the container is
       * not a jar or it has no certificates.
- *
- * @exception IOException if the manifest cannot be read.
       */
- private Certificate[] getCertificates(final File container, final String entry)
- throws IOException {
+ private Certificate[] getCertificates(final File container, final String entry) {
          if (container.isDirectory()) {
              return null;
          }

http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/Concat.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/Concat.java b/src/main/org/apache/tools/ant/taskdefs/Concat.java
index 1338f2a..1af0143 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Concat.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Concat.java
@@ -383,7 +383,7 @@ public class Concat extends Task implements ResourceCollection {
          private ConcatResource(ResourceCollection c) {
              this.c = c;
          }
- public InputStream getInputStream() throws IOException {
+ public InputStream getInputStream() {
              if (binary) {
                  ConcatResourceInputStream result = new ConcatResourceInputStream(c);
                  result.setManagingComponent(this);

http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/Jar.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java
index 28738b1..a0337e1 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Jar.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java
@@ -1036,8 +1036,7 @@ public class Jar extends Zip {
       * @since Ant 1.6.2
       */
      protected final void writeIndexLikeList(List<String> dirs, List<String> files,
- PrintWriter writer)
- throws IOException {
+ PrintWriter writer) {
          // JarIndex is sorting the directories by ascending order.
          // it has no value but cosmetic since it will be read into a
          // hashtable by the classloader, but we'll do so anyway.

http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/Zip.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java
index 91e28b9..5d68b2f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Zip.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java
@@ -1026,8 +1026,7 @@ public class Zip extends MatchingTask {
       * Determine a Resource's Unix mode or return the given default
       * value if not available.
       */
- private int getUnixMode(final Resource r, final ZipFile zf, final int defaultMode)
- throws IOException {
+ private int getUnixMode(final Resource r, final ZipFile zf, final int defaultMode) {

          int unixMode = defaultMode;
          if (zf != null) {

http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
index ad9aee8..e83c0b6 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
@@ -378,8 +378,6 @@ public class Symlink extends DispatchTask {
       *
       * @param path A string containing the path of the symlink to delete.
       *
- * @throws FileNotFoundException When the path results in a
- * <code>File</code> that doesn't exist.
       * @throws IOException If calls to <code>File.rename</code>
       * or <code>File.delete</code> fail.
       * @deprecated use
@@ -388,7 +386,7 @@ public class Symlink extends DispatchTask {
       */
      @Deprecated
      public static void deleteSymlink(String path)
- throws IOException, FileNotFoundException {
+ throws IOException {
          SYMLINK_UTILS.deleteSymbolicLink(new File(path), null);
      }


http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/util/UUEncoder.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/UUEncoder.java b/src/main/org/apache/tools/ant/util/UUEncoder.java
index 77e1bee..c42dcab 100644
--- a/src/main/org/apache/tools/ant/util/UUEncoder.java
+++ b/src/main/org/apache/tools/ant/util/UUEncoder.java
@@ -81,7 +81,7 @@ public class UUEncoder {
      /**
       * Encode a string to the output.
       */
- private void encodeString(String n) throws IOException {
+ private void encodeString(String n) {
          PrintStream writer = new PrintStream(out);
          writer.print(n);
          writer.flush();

Search Discussions

  • Bodewig at May 27, 2016 at 1:59 pm
    Repository: ant
    Updated Branches:
       refs/heads/master d28974c28 -> 1be6cf50a


    remove unused throws clauses

    https://bz.apache.org/bugzilla/attachment.cgi?id=33898

    Patch-by: Dave Brosius <dbrosius@apache.org>


    Project: http://git-wip-us.apache.org/repos/asf/ant/repo
    Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/82b2e47b
    Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/82b2e47b
    Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/82b2e47b

    Branch: refs/heads/master
    Commit: 82b2e47ba8774acf2ee97cc4c230c680223cd981
    Parents: deaa7d5
    Author: Stefan Bodewig <bodewig@apache.org>
    Authored: Fri May 27 15:56:11 2016 +0200
    Committer: Stefan Bodewig <bodewig@apache.org>
    Committed: Fri May 27 15:56:11 2016 +0200

    ----------------------------------------------------------------------
      src/main/org/apache/tools/ant/AntClassLoader.java | 5 +----
      src/main/org/apache/tools/ant/taskdefs/Concat.java | 2 +-
      src/main/org/apache/tools/ant/taskdefs/Jar.java | 3 +--
      src/main/org/apache/tools/ant/taskdefs/Zip.java | 3 +--
      .../org/apache/tools/ant/taskdefs/optional/unix/Symlink.java | 4 +---
      src/main/org/apache/tools/ant/util/UUEncoder.java | 2 +-
      6 files changed, 6 insertions(+), 13 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/AntClassLoader.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/AntClassLoader.java b/src/main/org/apache/tools/ant/AntClassLoader.java
    index 129b004..96b92fc 100644
    --- a/src/main/org/apache/tools/ant/AntClassLoader.java
    +++ b/src/main/org/apache/tools/ant/AntClassLoader.java
    @@ -1210,11 +1210,8 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener, Clo
           *
           * @return the entry's certificates or null is the container is
           * not a jar or it has no certificates.
    - *
    - * @exception IOException if the manifest cannot be read.
           */
    - private Certificate[] getCertificates(final File container, final String entry)
    - throws IOException {
    + private Certificate[] getCertificates(final File container, final String entry) {
              if (container.isDirectory()) {
                  return null;
              }

    http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/Concat.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/taskdefs/Concat.java b/src/main/org/apache/tools/ant/taskdefs/Concat.java
    index 1338f2a..1af0143 100644
    --- a/src/main/org/apache/tools/ant/taskdefs/Concat.java
    +++ b/src/main/org/apache/tools/ant/taskdefs/Concat.java
    @@ -383,7 +383,7 @@ public class Concat extends Task implements ResourceCollection {
              private ConcatResource(ResourceCollection c) {
                  this.c = c;
              }
    - public InputStream getInputStream() throws IOException {
    + public InputStream getInputStream() {
                  if (binary) {
                      ConcatResourceInputStream result = new ConcatResourceInputStream(c);
                      result.setManagingComponent(this);

    http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/Jar.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java
    index 28738b1..a0337e1 100644
    --- a/src/main/org/apache/tools/ant/taskdefs/Jar.java
    +++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java
    @@ -1036,8 +1036,7 @@ public class Jar extends Zip {
           * @since Ant 1.6.2
           */
          protected final void writeIndexLikeList(List<String> dirs, List<String> files,
    - PrintWriter writer)
    - throws IOException {
    + PrintWriter writer) {
              // JarIndex is sorting the directories by ascending order.
              // it has no value but cosmetic since it will be read into a
              // hashtable by the classloader, but we'll do so anyway.

    http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/Zip.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java
    index 91e28b9..5d68b2f 100644
    --- a/src/main/org/apache/tools/ant/taskdefs/Zip.java
    +++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java
    @@ -1026,8 +1026,7 @@ public class Zip extends MatchingTask {
           * Determine a Resource's Unix mode or return the given default
           * value if not available.
           */
    - private int getUnixMode(final Resource r, final ZipFile zf, final int defaultMode)
    - throws IOException {
    + private int getUnixMode(final Resource r, final ZipFile zf, final int defaultMode) {

              int unixMode = defaultMode;
              if (zf != null) {

    http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
    index ad9aee8..e83c0b6 100644
    --- a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
    +++ b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
    @@ -378,8 +378,6 @@ public class Symlink extends DispatchTask {
           *
           * @param path A string containing the path of the symlink to delete.
           *
    - * @throws FileNotFoundException When the path results in a
    - * <code>File</code> that doesn't exist.
           * @throws IOException If calls to <code>File.rename</code>
           * or <code>File.delete</code> fail.
           * @deprecated use
    @@ -388,7 +386,7 @@ public class Symlink extends DispatchTask {
           */
          @Deprecated
          public static void deleteSymlink(String path)
    - throws IOException, FileNotFoundException {
    + throws IOException {
              SYMLINK_UTILS.deleteSymbolicLink(new File(path), null);
          }


    http://git-wip-us.apache.org/repos/asf/ant/blob/82b2e47b/src/main/org/apache/tools/ant/util/UUEncoder.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/util/UUEncoder.java b/src/main/org/apache/tools/ant/util/UUEncoder.java
    index 77e1bee..c42dcab 100644
    --- a/src/main/org/apache/tools/ant/util/UUEncoder.java
    +++ b/src/main/org/apache/tools/ant/util/UUEncoder.java
    @@ -81,7 +81,7 @@ public class UUEncoder {
          /**
           * Encode a string to the output.
           */
    - private void encodeString(String n) throws IOException {
    + private void encodeString(String n) {
              PrintStream writer = new PrintStream(out);
              writer.print(n);
              writer.flush();
  • Bodewig at May 27, 2016 at 1:59 pm
    Merge branch '1.9.x'


    Project: http://git-wip-us.apache.org/repos/asf/ant/repo
    Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/a4381a68
    Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/a4381a68
    Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/a4381a68

    Branch: refs/heads/master
    Commit: a4381a68ebac693ec51d6fdac215df1e147f8b08
    Parents: d28974c 82b2e47
    Author: Stefan Bodewig <bodewig@apache.org>
    Authored: Fri May 27 15:57:45 2016 +0200
    Committer: Stefan Bodewig <bodewig@apache.org>
    Committed: Fri May 27 15:57:45 2016 +0200

    ----------------------------------------------------------------------
      src/main/org/apache/tools/ant/AntClassLoader.java | 5 +----
      src/main/org/apache/tools/ant/taskdefs/Concat.java | 2 +-
      src/main/org/apache/tools/ant/taskdefs/Jar.java | 3 +--
      src/main/org/apache/tools/ant/taskdefs/Zip.java | 3 +--
      .../org/apache/tools/ant/taskdefs/optional/unix/Symlink.java | 4 +---
      src/main/org/apache/tools/ant/util/UUEncoder.java | 2 +-
      6 files changed, 6 insertions(+), 13 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/ant/blob/a4381a68/src/main/org/apache/tools/ant/AntClassLoader.java
    ----------------------------------------------------------------------

    http://git-wip-us.apache.org/repos/asf/ant/blob/a4381a68/src/main/org/apache/tools/ant/taskdefs/Jar.java
    ----------------------------------------------------------------------

    http://git-wip-us.apache.org/repos/asf/ant/blob/a4381a68/src/main/org/apache/tools/ant/taskdefs/Zip.java
    ----------------------------------------------------------------------
  • Bodewig at May 27, 2016 at 1:59 pm
    remove unused throws clauses

    https://bz.apache.org/bugzilla/attachment.cgi?id=33898

    Patch-by: Dave Brosius <dbrosius@apache.org>


    Project: http://git-wip-us.apache.org/repos/asf/ant/repo
    Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/1be6cf50
    Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/1be6cf50
    Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/1be6cf50

    Branch: refs/heads/master
    Commit: 1be6cf50a85e1fcd6bfd66e3a1e0fa7b0797fc78
    Parents: a4381a6
    Author: Stefan Bodewig <bodewig@apache.org>
    Authored: Fri May 27 15:59:00 2016 +0200
    Committer: Stefan Bodewig <bodewig@apache.org>
    Committed: Fri May 27 15:59:00 2016 +0200

    ----------------------------------------------------------------------
      src/main/org/apache/tools/ant/launch/Locator.java | 14 +++++---------
      .../apache/tools/ant/taskdefs/ManifestClassPath.java | 7 ++-----
      2 files changed, 7 insertions(+), 14 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/ant/blob/1be6cf50/src/main/org/apache/tools/ant/launch/Locator.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/launch/Locator.java b/src/main/org/apache/tools/ant/launch/Locator.java
    index 4640e70..2e8c37d 100644
    --- a/src/main/org/apache/tools/ant/launch/Locator.java
    +++ b/src/main/org/apache/tools/ant/launch/Locator.java
    @@ -23,6 +23,7 @@ import java.io.FilenameFilter;
      import java.io.UnsupportedEncodingException;
      import java.net.MalformedURLException;
      import java.net.URL;
    +import java.nio.charset.StandardCharsets;
      import java.text.CharacterIterator;
      import java.text.StringCharacterIterator;
      import java.util.Locale;
    @@ -59,10 +60,6 @@ public final class Locator {
          private static final int SPACE = 0x20;
          private static final int DEL = 0x7F;

    - /**
    - * encoding used to represent URIs
    - */
    - public static final String URI_ENCODING = "UTF-8";
          // stolen from org.apache.xerces.impl.XMLEntityManager#getUserDir()
          // of the Xerces-J team
          // which ASCII characters need to be escaped
    @@ -315,11 +312,11 @@ public final class Locator {
                  } else if (c >= 0x0000 && c < 0x0080) {
                      sb.write(c);
                  } else { // #50543
    - byte[] bytes = String.valueOf(c).getBytes(URI_ENCODING);
    + byte[] bytes = String.valueOf(c).getBytes(StandardCharsets.UTF_8);
                      sb.write(bytes, 0, bytes.length);
                  }
              }
    - return sb.toString(URI_ENCODING);
    + return sb.toString(StandardCharsets.UTF_8.name());
          }

          /**
    @@ -327,10 +324,9 @@ public final class Locator {
           * The URI is escaped
           * @param path String to encode.
           * @return The encoded string, according to URI norms
    - * @throws UnsupportedEncodingException if UTF-8 is not available
           * @since Ant 1.7
           */
    - public static String encodeURI(String path) throws UnsupportedEncodingException {
    + public static String encodeURI(String path) {
              int i = 0;
              int len = path.length();
              int ch = 0;
    @@ -362,7 +358,7 @@ public final class Locator {
                  // get UTF-8 bytes for the remaining sub-string
                  byte[] bytes = null;
                  byte b;
    - bytes = path.substring(i).getBytes(URI_ENCODING);
    + bytes = path.substring(i).getBytes(StandardCharsets.UTF_8);
                  len = bytes.length;

                  // for each byte

    http://git-wip-us.apache.org/repos/asf/ant/blob/1be6cf50/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java b/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java
    index 4a4f231..f605bd5 100644
    --- a/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java
    +++ b/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java
    @@ -115,11 +115,8 @@ public class ManifestClassPath extends Task {
                  if (pathEntry.isDirectory() && !relPath.endsWith("/")) {
                      relPath = relPath + '/';
                  }
    - try {
    - relPath = Locator.encodeURI(relPath);
    - } catch (UnsupportedEncodingException exc) {
    - throw new BuildException(exc);
    - }
    + relPath = Locator.encodeURI(relPath);
    +
                  // Manifest's ClassPath: attribute always uses forward
                  // slashes '/', and is space-separated. Ant will properly
                  // format it on 72 columns with proper line continuation

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnotifications @
categoriesant
postedMay 27, '16 at 1:57p
activeMay 27, '16 at 1:59p
posts4
users1
websiteant.apache.org

1 user in discussion

Bodewig: 4 posts

People

Translate

site design / logo © 2018 Grokbase