You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/03/16 14:52:25 UTC

[camel] branch master updated (959f6ad -> 37721e8)

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

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


    from 959f6ad  CAMEL-14642: camel-spring-boot - Using max duration and shutdown before should terminate scheduled thread quicker
     new f1806d9  Try-with-resources: Lets use in the catalog
     new 242b415  Camel-Catalog: Fixed CS
     new adc6964  Try-with-resources: Lets use in the catalog-karaf-provider
     new 37721e8  Camel-catalog-karaf-provider: Fixed CS

The 4 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/catalog/karaf/KarafRuntimeProvider.java  | 65 +++++++++++++---------
 .../camel/catalog/DefaultRuntimeProvider.java      | 60 ++++++++++++--------
 2 files changed, 75 insertions(+), 50 deletions(-)


[camel] 01/04: Try-with-resources: Lets use in the catalog

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f1806d9ef9ceb7b9371a9814a7e535a87a9daf8b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 16 15:29:17 2020 +0100

    Try-with-resources: Lets use in the catalog
---
 .../apache/camel/catalog/DefaultRuntimeProvider.java | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java b/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java
index b943647..9efe85d 100644
--- a/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java
+++ b/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java
@@ -107,7 +107,7 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
     @Override
     public List<String> findComponentNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getComponentsCatalog());
+        try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getComponentsCatalog())) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -115,13 +115,16 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore 
+		}
         return names;
     }
 
     @Override
     public List<String> findDataFormatNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getDataFormatsCatalog());
+        try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getDataFormatsCatalog())) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -129,13 +132,16 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore
+		}
         return names;
     }
 
     @Override
     public List<String> findLanguageNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getLanguageCatalog());
+        try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getLanguageCatalog())) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -143,13 +149,16 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore
+		}
         return names;
     }
 
     @Override
     public List<String> findOtherNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getOtherCatalog());
+        try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getOtherCatalog())) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -157,6 +166,9 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore
+		}
         return names;
     }
 }


[camel] 03/04: Try-with-resources: Lets use in the catalog-karaf-provider

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit adc6964c57c3bc87f9e023c1b67f90cb4a1878c6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 16 15:47:40 2020 +0100

    Try-with-resources: Lets use in the catalog-karaf-provider
---
 .../camel/catalog/karaf/KarafRuntimeProvider.java    | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java b/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java
index 141759f..c382776 100644
--- a/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java
+++ b/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java
@@ -90,7 +90,7 @@ public class KarafRuntimeProvider implements RuntimeProvider {
     @Override
     public List<String> findComponentNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = camelCatalog.getVersionManager().getResourceAsStream(COMPONENTS_CATALOG);
+        try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(COMPONENTS_CATALOG)) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -98,13 +98,16 @@ public class KarafRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore
+		}
         return names;
     }
 
     @Override
     public List<String> findDataFormatNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = camelCatalog.getVersionManager().getResourceAsStream(DATA_FORMATS_CATALOG);
+        try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(DATA_FORMATS_CATALOG)) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -112,13 +115,16 @@ public class KarafRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore
+		}
         return names;
     }
 
     @Override
     public List<String> findLanguageNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = camelCatalog.getVersionManager().getResourceAsStream(LANGUAGE_CATALOG);
+        try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(LANGUAGE_CATALOG)) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -126,13 +132,16 @@ public class KarafRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore
+		}
         return names;
     }
 
     @Override
     public List<String> findOtherNames() {
         List<String> names = new ArrayList<>();
-        InputStream is = camelCatalog.getVersionManager().getResourceAsStream(OTHER_CATALOG);
+        try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(OTHER_CATALOG)) {
         if (is != null) {
             try {
                 CatalogHelper.loadLines(is, names);
@@ -140,6 +149,9 @@ public class KarafRuntimeProvider implements RuntimeProvider {
                 // ignore
             }
         }
+        } catch (IOException e1) {
+			// ignore
+		}
         return names;
     }
 


[camel] 02/04: Camel-Catalog: Fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 242b415352f572a0a4c091b2a3088043c888e790
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 16 15:33:34 2020 +0100

    Camel-Catalog: Fixed CS
---
 .../camel/catalog/DefaultRuntimeProvider.java      | 64 +++++++++++-----------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java b/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java
index 9efe85d..c7c9ada 100644
--- a/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java
+++ b/catalog/camel-catalog/src/main/java/org/apache/camel/catalog/DefaultRuntimeProvider.java
@@ -108,16 +108,16 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
     public List<String> findComponentNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getComponentsCatalog())) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore 
-		}
+            // ignore
+        }
         return names;
     }
 
@@ -125,16 +125,16 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
     public List<String> findDataFormatNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getDataFormatsCatalog())) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore
-		}
+            // ignore
+        }
         return names;
     }
 
@@ -142,16 +142,16 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
     public List<String> findLanguageNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getLanguageCatalog())) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore
-		}
+            // ignore
+        }
         return names;
     }
 
@@ -159,16 +159,16 @@ public class DefaultRuntimeProvider implements RuntimeProvider {
     public List<String> findOtherNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = getCamelCatalog().getVersionManager().getResourceAsStream(getOtherCatalog())) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore
-		}
+            // ignore
+        }
         return names;
     }
 }


[camel] 04/04: Camel-catalog-karaf-provider: Fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 37721e8e7d1cdf5ae2b0b762f1ba12349b4c2e53
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 16 15:51:04 2020 +0100

    Camel-catalog-karaf-provider: Fixed CS
---
 .../camel/catalog/karaf/KarafRuntimeProvider.java  | 69 +++++++++++-----------
 1 file changed, 35 insertions(+), 34 deletions(-)

diff --git a/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java b/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java
index c382776..943aa0d 100644
--- a/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java
+++ b/catalog/camel-catalog-provider-karaf/src/main/java/org/apache/camel/catalog/karaf/KarafRuntimeProvider.java
@@ -26,8 +26,9 @@ import org.apache.camel.catalog.RuntimeProvider;
 import org.apache.camel.catalog.impl.CatalogHelper;
 
 /**
- * A karaf based {@link RuntimeProvider} which only includes the supported Camel components, data formats, languages and others
- * which can be installed in Karaf using the Camel Karaf features.xml descriptor.
+ * A karaf based {@link RuntimeProvider} which only includes the supported Camel
+ * components, data formats, languages and others which can be installed in
+ * Karaf using the Camel Karaf features.xml descriptor.
  */
 public class KarafRuntimeProvider implements RuntimeProvider {
 
@@ -91,16 +92,16 @@ public class KarafRuntimeProvider implements RuntimeProvider {
     public List<String> findComponentNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(COMPONENTS_CATALOG)) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore
-		}
+            // ignore
+        }
         return names;
     }
 
@@ -108,16 +109,16 @@ public class KarafRuntimeProvider implements RuntimeProvider {
     public List<String> findDataFormatNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(DATA_FORMATS_CATALOG)) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore
-		}
+            // ignore
+        }
         return names;
     }
 
@@ -125,16 +126,16 @@ public class KarafRuntimeProvider implements RuntimeProvider {
     public List<String> findLanguageNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(LANGUAGE_CATALOG)) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore
-		}
+            // ignore
+        }
         return names;
     }
 
@@ -142,16 +143,16 @@ public class KarafRuntimeProvider implements RuntimeProvider {
     public List<String> findOtherNames() {
         List<String> names = new ArrayList<>();
         try (InputStream is = camelCatalog.getVersionManager().getResourceAsStream(OTHER_CATALOG)) {
-        if (is != null) {
-            try {
-                CatalogHelper.loadLines(is, names);
-            } catch (IOException e) {
-                // ignore
+            if (is != null) {
+                try {
+                    CatalogHelper.loadLines(is, names);
+                } catch (IOException e) {
+                    // ignore
+                }
             }
-        }
         } catch (IOException e1) {
-			// ignore
-		}
+            // ignore
+        }
         return names;
     }