ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject ignite git commit: .NET - trying to fix
Date Thu, 13 Apr 2017 09:52:17 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477-debug 408995127 -> be56ff643


.NET - trying to fix


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

Branch: refs/heads/ignite-3477-debug
Commit: be56ff6432e50224865c1f3e6d8beb41c740ecd7
Parents: 4089951
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Apr 13 12:52:44 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Apr 13 12:52:44 2017 +0300

----------------------------------------------------------------------
 .../internal/binary/BinaryReaderExImpl.java     |  2 +-
 .../ignite/internal/binary/BinaryUtils.java     | 26 ++++++++++++++------
 2 files changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/be56ff64/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
index d6fefe3..c8ca803 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
@@ -1911,7 +1911,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx,
Bina
                 break;
 
             case BINARY_OBJ:
-                obj = BinaryUtils.doReadBinaryObject(in, ctx);
+                obj = BinaryUtils.doReadBinaryObject(in, ctx, false);
 
                 ((BinaryObjectImpl)obj).context(ctx);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/be56ff64/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index 15cb736..49a16cf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -1451,7 +1451,7 @@ public class BinaryUtils {
     /**
      * @return Value.
      */
-    public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx)
{
+    public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx,
boolean detach) {
         if (in.offheapPointer() > 0) {
             int len = in.readInt();
 
@@ -1464,10 +1464,23 @@ public class BinaryUtils {
             return new BinaryObjectOffheapImpl(ctx, in.offheapPointer() + pos, start, len);
         }
         else {
-            byte[] arr = doReadByteArray(in);
-            int start = in.readInt();
+            if (detach) {
+                int arrLen = in.readInt();
+
+                int objLen = length(in, in.position());
+                byte[] arr = in.readByteArray(objLen);
 
-            return new BinaryObjectImpl(ctx, arr, start);
+                in.position(in.position() + (arrLen - objLen));
+                int start = in.readInt();
+
+                return new BinaryObjectImpl(ctx, arr, start);
+            }
+            else {
+                byte[] arr = doReadByteArray(in);
+                int start = in.readInt();
+
+                return new BinaryObjectImpl(ctx, arr, start);
+            }
         }
     }
 
@@ -1896,10 +1909,7 @@ public class BinaryUtils {
                 return doReadMap(in, ctx, ldr, handles, false, null);
 
             case GridBinaryMarshaller.BINARY_OBJ: {
-                BinaryObject binObj0 = doReadBinaryObject(in, ctx);
-
-                if (detach && binObj0 instanceof BinaryObjectImpl)
-                    binObj0 = ((BinaryObjectImpl)binObj0).detach();
+                BinaryObject binObj0 = doReadBinaryObject(in, ctx, detach);
 
                 return binObj0;
             }


Mime
View raw message