ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/28] ignite git commit: IGNITE-3817: Fixed binary object re-build with missing schema.
Date Wed, 07 Sep 2016 09:25:44 GMT
IGNITE-3817: Fixed binary object re-build with missing schema.


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

Branch: refs/heads/ignite-1.6.7-test
Commit: 42963e6c99e9b282972e6ad67a813a8038cf580f
Parents: 40d4b6a
Author: Alexander Paschenko <apaschenko@gridgain.com>
Authored: Mon Sep 5 14:10:39 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Sep 5 14:10:39 2016 +0300

----------------------------------------------------------------------
 .../binary/builder/BinaryObjectBuilderImpl.java       |  2 +-
 .../binary/BinaryObjectBuilderAdditionalSelfTest.java | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/42963e6c/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
index 16c51b0..086da5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
@@ -199,7 +199,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
 
             Map<String, Integer> fieldsMeta = null;
 
-            if (reader != null) {
+            if (reader != null && BinaryUtils.hasSchema(flags)) {
                 BinarySchema schema = reader.schema();
 
                 Map<Integer, Object> assignedFldsById;

http://git-wip-us.apache.org/repos/asf/ignite/blob/42963e6c/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
index f999ad3..24806cb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
@@ -56,6 +56,7 @@ import org.apache.ignite.internal.binary.builder.BinaryBuilderEnum;
 import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
 import org.apache.ignite.internal.binary.mutabletest.GridBinaryMarshalerAwareTestClass;
 import org.apache.ignite.internal.binary.mutabletest.GridBinaryTestClasses;
+import org.apache.ignite.internal.binary.test.GridBinaryTestClass2;
 import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
 import org.apache.ignite.internal.processors.cache.binary.IgniteBinaryImpl;
 import org.apache.ignite.internal.util.lang.GridMapEntry;
@@ -1389,6 +1390,19 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
     }
 
     /**
+     * Ensure that object w/o schema can be re-built.
+     */
+    public void testBuildFromObjectWithoutSchema() {
+        BinaryObjectBuilderImpl binBuilder = wrap(new GridBinaryTestClass2());
+
+        BinaryObject binObj = binBuilder.build();
+
+        BinaryObjectBuilderImpl binBuilder2 = wrap(binObj);
+
+        binBuilder2.build();
+    }
+
+    /**
      * @param obj Object.
      * @return Object in binary format.
      */


Mime
View raw message