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

tilman pushed a commit to branch branch_3x
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/branch_3x by this push:
     new 8289d87d6 TIKA-4397: remove unused code, as suggested by syedamisbahh 
(also applies also to previous commits of this issue, except deprecation)
8289d87d6 is described below

commit 8289d87d6b749928943fe84c096fb62b1ee421e9
Author: Tilman Hausherr <[email protected]>
AuthorDate: Tue Apr 1 19:39:20 2025 +0200

    TIKA-4397: remove unused code, as suggested by syedamisbahh (also applies 
also to previous commits of this issue, except deprecation)
---
 .../src/main/java/org/apache/tika/config/TikaConfig.java    | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/tika-core/src/main/java/org/apache/tika/config/TikaConfig.java 
b/tika-core/src/main/java/org/apache/tika/config/TikaConfig.java
index ce7ca71f3..004e41644 100644
--- a/tika-core/src/main/java/org/apache/tika/config/TikaConfig.java
+++ b/tika-core/src/main/java/org/apache/tika/config/TikaConfig.java
@@ -703,16 +703,9 @@ public class TikaConfig {
                     return (CT) single;
                 }
             } else if (!supportsComposite()) {
-                // No composite support, just return the first one
-                if (loaded.size() == 1) {
-                    return (CT) loaded.get(0);
-                } else if (loaded.size() > 1) {
-                    throw new TikaConfigException(
-                            "Composite not supported for " + 
getParentTagName() +
-                                    ". Must specify only one child!");
-                } else {
-                    //throw exception if empty?
-                }
+                throw new TikaConfigException(
+                        "Composite not supported for " + getParentTagName() +
+                                ". Must specify only one child!");
             }
             // Wrap the defined parsers/detectors up in a Composite
             return createComposite(loaded, mimeTypes, loader);

Reply via email to