ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [1/4] incubator-ignite git commit: # IGNITE-1131 Handle non-file codebase URI.
Date Tue, 21 Jul 2015 11:27:28 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-752 49098e93e -> ec1c76606


# IGNITE-1131 Handle non-file codebase URI.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a6b8764e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a6b8764e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a6b8764e

Branch: refs/heads/ignite-752
Commit: a6b8764e8b8b7f8bb0779106cd89de131e64aeb6
Parents: f0d24f6
Author: sevdokimov <sergey.evdokimov@jetbrains.com>
Authored: Fri Jul 17 14:32:11 2015 +0300
Committer: sevdokimov <sergey.evdokimov@jetbrains.com>
Committed: Fri Jul 17 14:32:11 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/IgniteUtils.java       | 21 +++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6b8764e/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 66eb596..2d5887c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -3134,7 +3134,7 @@ public abstract class IgniteUtils {
                 return ggHome0;
         }
 
-        URI uri;
+        URI classesUri;
 
         Class<IgniteUtils> cls = IgniteUtils.class;
 
@@ -3149,11 +3149,11 @@ public abstract class IgniteUtils {
             }
 
             // Resolve path to class-file.
-            uri = domain.getCodeSource().getLocation().toURI();
+            classesUri = domain.getCodeSource().getLocation().toURI();
 
             // Overcome UNC path problem on Windows (http://www.tomergabel.com/JavaMishandlesUNCPathsOnWindows.aspx)
-            if (isWindows() && uri.getAuthority() != null)
-                uri = new URI(uri.toString().replace("file://", "file:/"));
+            if (isWindows() && classesUri.getAuthority() != null)
+                classesUri = new URI(classesUri.toString().replace("file://", "file:/"));
         }
         catch (URISyntaxException | SecurityException e) {
             logResolveFailed(cls, e);
@@ -3161,7 +3161,18 @@ public abstract class IgniteUtils {
             return null;
         }
 
-        return findProjectHome(new File(uri));
+        File classesFile;
+
+        try {
+            classesFile = new File(classesUri);
+        }
+        catch (IllegalArgumentException e) {
+            logResolveFailed(cls, e);
+
+            return null;
+        }
+
+        return findProjectHome(classesFile);
     }
 
     /**


Mime
View raw message