You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/11/30 13:10:22 UTC
[39/50] [abbrv] ignite git commit: Skip metadata check in builder if
write null value.
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-rc1
Commit: a5d9993199a51d2d6d6203b7f725b11182c4d632
Parents: ee5d9fd
Author: sboikov <sb...@gridgain.com>
Authored: Sat Nov 28 16:00:50 2015 +0300
Committer: sboikov <sb...@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)) {