IGNITE-1282: Better raw handling in a single commit.

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

Branch: refs/heads/ignite-1816
Commit: 9f9f4cc2d6e910d321bc8061f1de15038e1ba34a
Parents: 354ea25
Author: vozerov-gridgain <[email protected]>
Authored: Thu Nov 12 12:17:54 2015 +0300
Committer: vozerov-gridgain <[email protected]>
Committed: Thu Nov 12 12:17:54 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/portable/BinaryWriterExImpl.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9f9f4cc2/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java
index 2bb541a..316e700 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java
@@ -366,11 +366,14 @@ public class BinaryWriterExImpl implements BinaryWriter, 
BinaryRawWriterEx, Obje
                 flags |= PortableUtils.FLAG_OFFSET_TWO_BYTES;
         }
         else {
-            if (rawOffPos != 0)
+            if (rawOffPos != 0) {
+                // If there are no schema, we are free to write raw offset to 
schema offset.
                 flags |= PortableUtils.FLAG_HAS_RAW;
 
-            // If there are no schema, we are free to write raw offset to 
schema offset.
-            out.writeInt(start + SCHEMA_OR_RAW_OFF_POS, (rawOffPos == 0 ? 
out.position() : rawOffPos) - start);
+                out.writeInt(start + SCHEMA_OR_RAW_OFF_POS, rawOffPos - start);
+            }
+            else
+                out.writeInt(start + SCHEMA_OR_RAW_OFF_POS, 0);
         }
 
         // Write flags.

Reply via email to