tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pottlin...@apache.org
Subject [incubator-tamaya] 03/03: Fix IDE warnings.
Date Wed, 01 May 2019 20:12:59 GMT
This is an automated email from the ASF dual-hosted git repository.

pottlinger pushed a commit to branch try_with_resource
in repository https://gitbox.apache.org/repos/asf/incubator-tamaya.git

commit 90581a94b99945e19abe6b8189020ee31fcc922f
Author: Hugo Hirsch <github@hugo-hirsch.de>
AuthorDate: Wed May 1 22:12:38 2019 +0200

    Fix IDE warnings.
---
 .../java/org/apache/tamaya/core/internal/OSGIServiceLoader.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceLoader.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceLoader.java
index 76f3b4b..d0f1ac3 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceLoader.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceLoader.java
@@ -191,7 +191,7 @@ public class OSGIServiceLoader implements BundleListener {
             URL child = bundle.getEntry(entryPath);
             InputStream inStream = child.openStream();
 
-            try (BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8")))
{
+            try (BufferedReader br = new BufferedReader(new InputStreamReader(inStream, StandardCharsets.UTF_8)))
{
                 String implClassName = br.readLine();
                 while (implClassName != null) {
                     int hashIndex = implClassName.indexOf("#");
@@ -215,9 +215,7 @@ public class OSGIServiceLoader implements BundleListener {
                             if (ref != null) {
                                 bundle.getBundleContext().ungetService(ref);
                             }
-                        } catch (Exception e) {
-                            LOG.log(Level.SEVERE, "Failed to unload service: " + implClassName,
e);
-                        } catch (NoClassDefFoundError err) {
+                        } catch (NoClassDefFoundError | Exception err) {
                             LOG.log(Level.SEVERE, "Failed to unload service: " + implClassName,
err);
                         }
                     }


Mime
View raw message