Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 366981861D for ; Thu, 23 Jul 2015 12:51:45 +0000 (UTC) Received: (qmail 11650 invoked by uid 500); 23 Jul 2015 12:51:42 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 11623 invoked by uid 500); 23 Jul 2015 12:51:42 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 11614 invoked by uid 99); 23 Jul 2015 12:51:42 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2015 12:51:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 8EB3FD6FF8 for ; Thu, 23 Jul 2015 12:51:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.574 X-Spam-Level: X-Spam-Status: No, score=0.574 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.227, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id kVdSA2aLGKaX for ; Thu, 23 Jul 2015 12:51:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 71DD22C6A2 for ; Thu, 23 Jul 2015 12:51:25 +0000 (UTC) Received: (qmail 8186 invoked by uid 99); 23 Jul 2015 12:51:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2015 12:51:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 36FF0E681D; Thu, 23 Jul 2015 12:51:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 23 Jul 2015 12:51:30 -0000 Message-Id: <75bf09c629ce41959473a0ea9a1f7681@git.apache.org> In-Reply-To: <43889123f6864b0896167376fab79223@git.apache.org> References: <43889123f6864b0896167376fab79223@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/50] incubator-ignite git commit: # IGNITE-1131 Handle non-file codebase URI. # 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-gg-10212 Commit: a6b8764e8b8b7f8bb0779106cd89de131e64aeb6 Parents: f0d24f6 Author: sevdokimov Authored: Fri Jul 17 14:32:11 2015 +0300 Committer: sevdokimov 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 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); } /**