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 2BABB1858D for ; Wed, 28 Oct 2015 14:26:44 +0000 (UTC) Received: (qmail 58361 invoked by uid 500); 28 Oct 2015 14:26:09 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 58206 invoked by uid 500); 28 Oct 2015 14:26:09 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 58118 invoked by uid 99); 28 Oct 2015 14:26:09 -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; Wed, 28 Oct 2015 14:26:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 25B40E0921; Wed, 28 Oct 2015 14:26:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Wed, 28 Oct 2015 14:26:13 -0000 Message-Id: <1e003ba63c5146c08d6872ce98e81d72@git.apache.org> In-Reply-To: <6867ee17b0ba4a4484156469d7749320@git.apache.org> References: <6867ee17b0ba4a4484156469d7749320@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/49] ignite git commit: ignite-1718: proper type name extraction in portable context for classes that ends on '$' sign ignite-1718: proper type name extraction in portable context for classes that ends on '$' sign Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e9524cea Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e9524cea Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e9524cea Branch: refs/heads/ignite-1758 Commit: e9524cea121ce70338bb9bf1a5f622acc445d5f0 Parents: 91e31e9 Author: Andrey Gura Authored: Thu Oct 22 11:05:02 2015 +0300 Committer: Denis Magda Committed: Thu Oct 22 11:05:02 2015 +0300 ---------------------------------------------------------------------- .../ignite/internal/portable/PortableContext.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e9524cea/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java index 1ad42ab..e9cccf0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java @@ -547,7 +547,6 @@ public class PortableContext implements Externalizable { try { registered = marshCtx.registerClass(typeId, cls); - } catch (IgniteCheckedException e) { throw new PortableException("Failed to register class.", e); @@ -891,10 +890,11 @@ public class PortableContext implements Externalizable { int idx = clsName.lastIndexOf('$'); - String typeName; - - if (idx >= 0) { - typeName = clsName.substring(idx + 1); + if (idx == clsName.length() - 1) + // This is a regular (not inner) class name that ends with '$'. Common use case for Scala classes. + idx = -1; + else if (idx >= 0) { + String typeName = clsName.substring(idx + 1); try { Integer.parseInt(typeName); @@ -1147,4 +1147,4 @@ public class PortableContext implements Externalizable { return registered; } } -} \ No newline at end of file +}