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 2024/02/10 21:31:59 UTC

(commons-compress) 02/07: Remove unused exceptions

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

commit a662a22c5a6e2adc4619d8161a3a5155b5697cfc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Feb 10 16:18:32 2024 -0500

    Remove unused exceptions
    
    Binary compatible
---
 .../commons/compress/archivers/zip/ExtraFieldUtils.java      | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java b/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
index 238642d57..1ca0c66e0 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
@@ -144,10 +144,8 @@ public class ExtraFieldUtils {
      *
      * @param headerId the header identifier
      * @return an instance of the appropriate ExtraField
-     * @throws InstantiationException if unable to instantiate the class
-     * @throws IllegalAccessException if not allowed to instantiate the class
      */
-    public static ZipExtraField createExtraField(final ZipShort headerId) throws InstantiationException, IllegalAccessException {
+    public static ZipExtraField createExtraField(final ZipShort headerId) {
         final ZipExtraField field = createExtraFieldNoDefault(headerId);
         if (field != null) {
             return field;
@@ -158,15 +156,13 @@ public class ExtraFieldUtils {
     }
 
     /**
-     * Creates an instance of the appropriate ExtraField.
+     * Creates an instance of the appropriate {@link ZipExtraField}.
      *
      * @param headerId the header identifier
-     * @return an instance of the appropriate ExtraField or null if the id is not supported
-     * @throws InstantiationException if unable to instantiate the class
-     * @throws IllegalAccessException if not allowed to instantiate the class
+     * @return an instance of the appropriate {@link ZipExtraField} or null if the id is not supported
      * @since 1.19
      */
-    public static ZipExtraField createExtraFieldNoDefault(final ZipShort headerId) throws InstantiationException, IllegalAccessException {
+    public static ZipExtraField createExtraFieldNoDefault(final ZipShort headerId) {
         final Supplier<ZipExtraField> provider = IMPLEMENTATIONS.get(headerId);
         return provider != null ? provider.get() : null;
     }