You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/04/17 09:59:46 UTC

[camel] 09/13: (chores) camel-stax: combined duplicated catch blocks

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

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 8015b28ebfe519f2a33aa7c359c5d4b9987ced04
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Apr 17 10:20:44 2023 +0200

    (chores) camel-stax: combined duplicated catch blocks
---
 .../camel/component/stax/StAXJAXBIteratorExpression.java      | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
index 7d5afd909ef..40f265349b4 100644
--- a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
+++ b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXJAXBIteratorExpression.java
@@ -134,16 +134,7 @@ public class StAXJAXBIteratorExpression<T> extends ExpressionAdapter {
                 clazz = (Class<T>) exchange.getContext().getClassResolver().resolveMandatoryClass(handledName);
             }
             return createIterator(reader, clazz, inputStream);
-        } catch (InvalidPayloadException e) {
-            exchange.setException(e);
-            return null;
-        } catch (JAXBException e) {
-            exchange.setException(e);
-            return null;
-        } catch (ClassNotFoundException e) {
-            exchange.setException(e);
-            return null;
-        } catch (XMLStreamException e) {
+        } catch (InvalidPayloadException | JAXBException | ClassNotFoundException | XMLStreamException e) {
             exchange.setException(e);
             return null;
         }