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/06/09 14:24:02 UTC

[camel] branch main updated (f668488a05b -> 5c0bdead12f)

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

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


    from f668488a05b (chores) core: removed methods that were identical to their parent methods
     new e10f5a8b5ae (chores) core: remove declared exceptions which are never thrown
     new 68122415a09 (chores) core: remove declared exceptions which are never thrown in private methods
     new 27bb983bd4b (chores) core: remove declared exceptions which are never thrown in public methods in anonymous classes
     new 28477e5680c (chores) core: remove declared exceptions which are never thrown in public static methods
     new 5c0bdead12f (chores) core: remove declared exceptions which are never thrown in private inner classes

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/converter/stream/FileInputStreamCache.java       | 13 ++++---------
 .../main/java/org/apache/camel/support/GroupIterator.java  |  2 +-
 .../java/org/apache/camel/support/LazyStartProducer.java   | 14 +++++++-------
 .../org/apache/camel/support/PropertyBindingSupport.java   |  6 ++----
 .../main/java/org/apache/camel/support/ResourceHelper.java |  2 +-
 .../java/org/apache/camel/support/RestComponentHelper.java |  9 +++------
 .../camel/throttling/ThrottlingInflightRoutePolicy.java    |  2 +-
 7 files changed, 19 insertions(+), 29 deletions(-)


[camel] 01/05: (chores) core: remove declared exceptions which are never thrown

Posted by or...@apache.org.
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 e10f5a8b5aed36249ca6b231e4186a1f6b6b34f1
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 9 14:46:01 2023 +0200

    (chores) core: remove declared exceptions which are never thrown
    
    The class is final and the exception is never thrown
---
 .../camel/converter/stream/FileInputStreamCache.java       | 13 ++++---------
 .../java/org/apache/camel/support/LazyStartProducer.java   | 14 +++++++-------
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java b/core/camel-support/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
index 3a308f6a477..dab0c36ad1c 100644
--- a/core/camel-support/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
+++ b/core/camel-support/src/main/java/org/apache/camel/converter/stream/FileInputStreamCache.java
@@ -19,7 +19,6 @@ package org.apache.camel.converter.stream;
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -58,11 +57,11 @@ public final class FileInputStreamCache extends InputStream implements StreamCac
     private final CipherPair ciphers;
 
     /** Only for testing purposes. */
-    public FileInputStreamCache(File file) throws FileNotFoundException {
+    public FileInputStreamCache(File file) {
         this(new TempFileManager(file, true));
     }
 
-    FileInputStreamCache(TempFileManager closer) throws FileNotFoundException {
+    FileInputStreamCache(TempFileManager closer) {
         this.file = closer.getTempFile();
         this.stream = null;
         this.ciphers = closer.getCiphers();
@@ -332,12 +331,8 @@ public final class FileInputStreamCache extends InputStream implements StreamCac
             return out;
         }
 
-        FileInputStreamCache newStreamCache() throws IOException {
-            try {
-                return new FileInputStreamCache(this);
-            } catch (FileNotFoundException e) {
-                throw new IOException("Cached file " + tempFile + " not found", e);
-            }
+        FileInputStreamCache newStreamCache() {
+            return new FileInputStreamCache(this);
         }
 
         void closeFileInputStreams() {
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java b/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java
index 3faee59942e..4d6b946e446 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java
@@ -70,37 +70,37 @@ public final class LazyStartProducer extends DefaultAsyncProducer implements Del
     }
 
     @Override
-    protected void doBuild() throws Exception {
+    protected void doBuild() {
         // noop as we dont want to start the delegate but its started on the first message processed
     }
 
     @Override
-    protected void doInit() throws Exception {
+    protected void doInit() {
         // noop as we dont want to start the delegate but its started on the first message processed
     }
 
     @Override
-    protected void doStart() throws Exception {
+    protected void doStart() {
         // noop as we dont want to start the delegate but its started on the first message processed
     }
 
     @Override
-    protected void doStop() throws Exception {
+    protected void doStop() {
         ServiceHelper.stopService(delegate);
     }
 
     @Override
-    protected void doSuspend() throws Exception {
+    protected void doSuspend() {
         ServiceHelper.suspendService(delegate);
     }
 
     @Override
-    protected void doResume() throws Exception {
+    protected void doResume() {
         ServiceHelper.resumeService(delegate);
     }
 
     @Override
-    protected void doShutdown() throws Exception {
+    protected void doShutdown() {
         ServiceHelper.stopAndShutdownService(delegate);
     }
 


[camel] 02/05: (chores) core: remove declared exceptions which are never thrown in private methods

Posted by or...@apache.org.
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 68122415a09c22020094855f36b2cbb5d5a3c9b7
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 9 14:46:23 2023 +0200

    (chores) core: remove declared exceptions which are never thrown in private methods
---
 .../src/main/java/org/apache/camel/support/GroupIterator.java       | 2 +-
 .../main/java/org/apache/camel/support/PropertyBindingSupport.java  | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/GroupIterator.java b/core/camel-support/src/main/java/org/apache/camel/support/GroupIterator.java
index e408008b80e..1de779860dc 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/GroupIterator.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/GroupIterator.java
@@ -92,7 +92,7 @@ public final class GroupIterator implements Iterator<Object>, Closeable {
         }
     }
 
-    private Object doNext() throws IOException {
+    private Object doNext() {
         List<Object> list = new ArrayList<>();
         int count = 0;
         while (count < group && it.hasNext()) {
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index f50807c1920..8bb9053b2d3 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -703,8 +703,7 @@ public final class PropertyBindingSupport {
 
     private static boolean setPropertyCollectionViaConfigurer(
             CamelContext camelContext, Object target, String name, Object value,
-            boolean ignoreCase, PropertyConfigurer configurer)
-            throws Exception {
+            boolean ignoreCase, PropertyConfigurer configurer) {
 
         final Object originalTarget = target;
 
@@ -833,8 +832,7 @@ public final class PropertyBindingSupport {
     private static Object resolveAutowired(
             CamelContext context, Object target, String name, Object value,
             boolean ignoreCase, boolean fluentBuilder, boolean allowPrivateSetter,
-            boolean reflection, PropertyConfigurer configurer)
-            throws Exception {
+            boolean reflection, PropertyConfigurer configurer) {
 
         String undashKey = undashKey(name);
 


[camel] 05/05: (chores) core: remove declared exceptions which are never thrown in private inner classes

Posted by or...@apache.org.
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 5c0bdead12f8bd46d24791fa551d21a744ba4ac0
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 9 14:51:32 2023 +0200

    (chores) core: remove declared exceptions which are never thrown in private inner classes
---
 .../java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java b/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java
index 7424d2a7b1a..f979d92b205 100644
--- a/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java
+++ b/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java
@@ -288,7 +288,7 @@ public class ThrottlingInflightRoutePolicy extends RoutePolicySupport implements
     private class ContextScopedEventNotifier extends EventNotifierSupport {
 
         @Override
-        public void notify(CamelEvent event) throws Exception {
+        public void notify(CamelEvent event) {
             ExchangeCompletedEvent completedEvent = (ExchangeCompletedEvent) event;
             for (Route route : routes) {
                 throttle(route, completedEvent.getExchange());


[camel] 03/05: (chores) core: remove declared exceptions which are never thrown in public methods in anonymous classes

Posted by or...@apache.org.
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 27bb983bd4b4dcf33a3273d66d63f96274f7ef3e
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 9 14:48:12 2023 +0200

    (chores) core: remove declared exceptions which are never thrown in public methods in anonymous classes
---
 .../src/main/java/org/apache/camel/support/ResourceHelper.java          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java
index f0a06f56233..33acc4f15c6 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java
@@ -301,7 +301,7 @@ public final class ResourceHelper {
             }
 
             @Override
-            public InputStream getInputStream() throws IOException {
+            public InputStream getInputStream() {
                 return new ByteArrayInputStream(content);
             }
         };


[camel] 04/05: (chores) core: remove declared exceptions which are never thrown in public static methods

Posted by or...@apache.org.
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 28477e5680cbff64239a6ae665b9ae748d9cbc41
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 9 14:49:36 2023 +0200

    (chores) core: remove declared exceptions which are never thrown in public static methods
---
 .../main/java/org/apache/camel/support/RestComponentHelper.java  | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/RestComponentHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/RestComponentHelper.java
index 33e15f2afd3..af2fee578f1 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/RestComponentHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/RestComponentHelper.java
@@ -101,8 +101,7 @@ public final class RestComponentHelper {
      * @return                    a string of the component route url
      * @throws URISyntaxException - is thrown if uri has invalid syntax.
      */
-    public static String createRestConsumerUrl(String componentName, String verb, String path, Map<String, Object> queryMap)
-            throws URISyntaxException {
+    public static String createRestConsumerUrl(String componentName, String verb, String path, Map<String, Object> queryMap) {
         String query = URISupport.createQueryString(queryMap);
         return applyFormatAndQuery("%s:%s:%s", query, componentName, verb, path);
     }
@@ -117,8 +116,7 @@ public final class RestComponentHelper {
      * @return                    a string of the component route url
      * @throws URISyntaxException - is thrown if uri has invalid syntax.
      */
-    public static String createRestConsumerUrl(String componentName, String path, Map<String, Object> queryMap)
-            throws URISyntaxException {
+    public static String createRestConsumerUrl(String componentName, String path, Map<String, Object> queryMap) {
         String query = URISupport.createQueryString(queryMap);
         return applyFormatAndQuery("%s:/%s", query, componentName, path);
     }
@@ -137,8 +135,7 @@ public final class RestComponentHelper {
      * @throws URISyntaxException - is thrown if uri has invalid syntax.
      */
     public static String createRestConsumerUrl(
-            String componentName, String scheme, String host, int port, String path, Map<String, Object> queryMap)
-            throws URISyntaxException {
+            String componentName, String scheme, String host, int port, String path, Map<String, Object> queryMap) {
 
         String query = URISupport.createQueryString(queryMap);