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 3786D1773B for ; Wed, 9 Dec 2015 15:24:16 +0000 (UTC) Received: (qmail 72243 invoked by uid 500); 9 Dec 2015 15:24:12 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 72176 invoked by uid 500); 9 Dec 2015 15:24:12 -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 72091 invoked by uid 99); 9 Dec 2015 15:24:12 -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, 09 Dec 2015 15:24:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 69B68E0B54; Wed, 9 Dec 2015 15:24:12 +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, 09 Dec 2015 15:24:13 -0000 Message-Id: In-Reply-To: <834fdc4770ca4e0f871a5f29ec13c5a7@git.apache.org> References: <834fdc4770ca4e0f871a5f29ec13c5a7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/17] ignite git commit: IGNITE-2064 Fixed Usage of Optimize classloader IGNITE-2064 Fixed Usage of Optimize classloader Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d0786551 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d0786551 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d0786551 Branch: refs/heads/ignite-1.5.1 Commit: d0786551aef92f77cbb23097de18745399d00d69 Parents: 5ea19a4 Author: Anton Vinogradov Authored: Tue Dec 8 16:39:36 2015 +0300 Committer: Anton Vinogradov Committed: Wed Dec 9 12:55:06 2015 +0300 ---------------------------------------------------------------------- .../portable/PortableClassDescriptor.java | 46 ++++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d0786551/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java index 984f7c9..ed65e63 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java @@ -17,13 +17,6 @@ package org.apache.ignite.internal.portable; -import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.internal.processors.cache.CacheObjectImpl; -import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.marshaller.MarshallerExclusions; -import org.apache.ignite.marshaller.optimized.OptimizedMarshaller; -import org.jetbrains.annotations.Nullable; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInputStream; @@ -43,10 +36,16 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.UUID; -import org.apache.ignite.binary.BinaryObjectException; +import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.binary.BinaryIdMapper; -import org.apache.ignite.binary.Binarylizable; +import org.apache.ignite.binary.BinaryObjectException; import org.apache.ignite.binary.BinarySerializer; +import org.apache.ignite.binary.Binarylizable; +import org.apache.ignite.internal.processors.cache.CacheObjectImpl; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.marshaller.MarshallerExclusions; +import org.apache.ignite.marshaller.optimized.OptimizedMarshaller; +import org.jetbrains.annotations.Nullable; import static java.lang.reflect.Modifier.isStatic; import static java.lang.reflect.Modifier.isTransient; @@ -268,11 +267,11 @@ public class PortableClassDescriptor { } } } - + fields = fields0.toArray(new BinaryFieldAccessor[fields0.size()]); - + stableSchema = schemaBuilder.build(); - + break; default: @@ -796,19 +795,20 @@ public class PortableClassDescriptor { * @return {@code true} if to use, {@code false} otherwise. */ private boolean initUseOptimizedMarshallerFlag() { - boolean use; - - try { - Method writeObj = cls.getDeclaredMethod("writeObject", ObjectOutputStream.class); - Method readObj = cls.getDeclaredMethod("readObject", ObjectInputStream.class); + for (Class c = cls; !c.equals(Object.class); c = c.getSuperclass()) { + try { + Method writeObj = c.getDeclaredMethod("writeObject", ObjectOutputStream.class); + Method readObj = c.getDeclaredMethod("readObject", ObjectInputStream.class); - use = !Modifier.isStatic(writeObj.getModifiers()) && !Modifier.isStatic(readObj.getModifiers()) && - writeObj.getReturnType() == void.class && readObj.getReturnType() == void.class; - } - catch (NoSuchMethodException e) { - use = false; + if (!Modifier.isStatic(writeObj.getModifiers()) && !Modifier.isStatic(readObj.getModifiers()) && + writeObj.getReturnType() == void.class && readObj.getReturnType() == void.class) + return true; + } + catch (NoSuchMethodException e) { + // No-op. + } } - return use; + return false; } }