ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [23/50] [abbrv] ignite git commit: Skip metadata check in builder if write null value.
Date Tue, 01 Dec 2015 09:02:35 GMT
Skip metadata check in builder if write null value.


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

Branch: refs/heads/ignite-843-rc2
Commit: a5d9993199a51d2d6d6203b7f725b11182c4d632
Parents: ee5d9fd
Author: sboikov <sboikov@gridgain.com>
Authored: Sat Nov 28 16:00:50 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Sat Nov 28 16:00:50 2015 +0300

----------------------------------------------------------------------
 .../portable/builder/BinaryObjectBuilderImpl.java       | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a5d99931/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
index 5c2c713..cadc781 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
@@ -311,10 +311,16 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder
{
 
                     String oldFldTypeName = meta == null ? null : meta.fieldTypeName(name);
 
+                    boolean nullObjField = false;
+
                     int newFldTypeId;
 
-                    if (val instanceof PortableValueWithType)
-                        newFldTypeId = ((PortableValueWithType) val).typeId();
+                    if (val instanceof PortableValueWithType) {
+                        newFldTypeId = ((PortableValueWithType)val).typeId();
+
+                        if (newFldTypeId == GridPortableMarshaller.OBJ && ((PortableValueWithType)val).value()
== null)
+                            nullObjField = true;
+                    }
                     else
                         newFldTypeId = PortableUtils.typeByClass(val.getClass());
 
@@ -327,7 +333,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
 
                         fieldsMeta.put(name, PortableUtils.fieldTypeId(newFldTypeName));
                     }
-                    else {
+                    else if (!nullObjField) {
                         String objTypeName = PortableUtils.fieldTypeName(GridPortableMarshaller.OBJ);
 
                         if (!objTypeName.equals(oldFldTypeName) && !oldFldTypeName.equals(newFldTypeName))
{


Mime
View raw message