ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/5] ignite git commit: IGNITE-1961: WIP 1 (TC is fine).
Date Fri, 20 Nov 2015 14:43:03 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1961 [created] 44baff685


IGNITE-1961: WIP 1 (TC is fine).


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

Branch: refs/heads/ignite-1961
Commit: 7a7bc5cb8ec4d5032b1a2e29748b7d33fa1909ee
Parents: a28649e
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Nov 20 15:46:09 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Nov 20 15:46:09 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/portable/BinaryReaderExImpl.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7a7bc5cb/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
index 5d31670..01e07c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
@@ -395,13 +395,13 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx,
Obje
      * @return Field.
      */
     private <T> T readHandleField() {
-        int handle = (in.position() - 1) - in.readInt();
-
-        int retPos = in.position();
+        int handle = positionForHandle() - in.readInt();
 
         Object obj = rCtx.get(handle);
 
         if (obj == null) {
+            int retPos = in.position();
+
             in.position(handle);
 
             obj = doReadObject();
@@ -1592,11 +1592,13 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx,
Obje
             return new String(doReadByteArray(), UTF_8);
 
         int strLen = in.readInt();
-        int strOff = in.position();
 
-        String res = new String(in.array(), strOff, strLen, UTF_8);
+        int pos = in.position();
+
+        // String will copy necessary array part for us.
+        String res = new String(in.array(), pos, strLen, UTF_8);
 
-        in.position(strOff + strLen);
+        in.position(pos + strLen);
 
         return res;
     }


Mime
View raw message