You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by st...@apache.org on 2017/11/27 15:06:24 UTC

[2/3] deltaspike git commit: DELTASPIKE-1278 avoid signature change

DELTASPIKE-1278 avoid signature change

previously we did not throw the URISyntaxException which
is a checked Exception. So this change did require to catch
that exception in user code.
Now handling this issue internally.


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/717771b2
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/717771b2
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/717771b2

Branch: refs/heads/master
Commit: 717771b275f406ce7ce43cd528be44d6053b7d2b
Parents: 77fa4b8
Author: Mark Struberg <st...@apache.org>
Authored: Mon Nov 27 15:57:36 2017 +0100
Committer: Mark Struberg <st...@apache.org>
Committed: Mon Nov 27 15:57:36 2017 +0100

----------------------------------------------------------------------
 .../deltaspike/core/util/PropertyFileUtils.java      | 15 +++++++++++----
 .../EnvironmentPropertyConfigSourceProvider.java     |  6 ------
 2 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/717771b2/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
index 813b988..f38029b 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/PropertyFileUtils.java
@@ -42,7 +42,7 @@ public abstract class PropertyFileUtils
         // prevent instantiation
     }
 
-    public static Enumeration<URL> resolvePropertyFiles(String propertyFileName) throws IOException, URISyntaxException
+    public static Enumeration<URL> resolvePropertyFiles(String propertyFileName) throws IOException
     {
         if (propertyFileName != null && (propertyFileName.contains("://") || propertyFileName.startsWith("file:")))
         {
@@ -52,10 +52,17 @@ public abstract class PropertyFileUtils
 
             if (propertyFileName.startsWith("file:"))
             {
-                File file = new File(url.toURI());
-                if (file.exists())
+                try
                 {
-                    propertyFileUrls.add(url);
+                    File file = new File(url.toURI());
+                    if (file.exists())
+                    {
+                        propertyFileUrls.add(url);
+                    }
+                }
+                catch (URISyntaxException e)
+                {
+                    throw new IllegalStateException("Property file URL is malformed", e);
                 }
             }
             else

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/717771b2/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/EnvironmentPropertyConfigSourceProvider.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/EnvironmentPropertyConfigSourceProvider.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/EnvironmentPropertyConfigSourceProvider.java
index 64d9cdd..b34e68c 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/EnvironmentPropertyConfigSourceProvider.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/EnvironmentPropertyConfigSourceProvider.java
@@ -19,7 +19,6 @@
 package org.apache.deltaspike.core.impl.config;
 
 import java.io.IOException;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Enumeration;
@@ -66,11 +65,6 @@ class EnvironmentPropertyConfigSourceProvider implements ConfigSourceProvider
         {
             throw new IllegalStateException("problem while loading DeltaSpike property files", ioe);
         }
-        catch (URISyntaxException ue)
-        {
-            throw new IllegalStateException("Property file URL is malformed", ue);
-        }
-
     }
 
     @Override