ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [02/16] ignite git commit: IGNITE-2203: Fixed a bug in BinaryClassDescriptor causing Externalizable object to be mistakenly analyzed for duplicate fields.
Date Mon, 21 Dec 2015 03:28:56 GMT
IGNITE-2203: Fixed a bug in BinaryClassDescriptor causing Externalizable object to be mistakenly
analyzed for duplicate fields.


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

Branch: refs/heads/ignite-843-rc2
Commit: 301e7a1af38a3d9ef8640e74070e8c6b558eb332
Parents: d5a56da
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Dec 18 11:46:50 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Dec 18 11:46:50 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/binary/BinaryClassDescriptor.java    | 5 ++++-
 .../java/org/apache/ignite/internal/binary/BinaryWriteMode.java | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/301e7a1a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
index eac1874..1eb3882 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
@@ -166,7 +166,7 @@ public class BinaryClassDescriptor {
         if (excluded)
             mode = BinaryWriteMode.EXCLUSION;
         else if (useOptMarshaller)
-            mode = BinaryWriteMode.OBJECT; // Will not be used anywhere.
+            mode = BinaryWriteMode.OPTIMIZED; // Will not be used anywhere.
         else {
             if (cls == BinaryEnumObjectImpl.class)
                 mode = BinaryWriteMode.BINARY_ENUM;
@@ -225,6 +225,7 @@ public class BinaryClassDescriptor {
             case BINARY_ENUM:
             case ENUM_ARR:
             case CLASS:
+            case OPTIMIZED:
             case EXCLUSION:
                 ctor = null;
                 fields = null;
@@ -395,6 +396,7 @@ public class BinaryClassDescriptor {
     void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException {
         assert obj != null;
         assert writer != null;
+        assert mode != BinaryWriteMode.OPTIMIZED : "OptimizedMarshaller should not be used
here: " + cls.getName();
 
         writer.typeId(typeId);
 
@@ -648,6 +650,7 @@ public class BinaryClassDescriptor {
      */
     Object read(BinaryReaderExImpl reader) throws BinaryObjectException {
         assert reader != null;
+        assert mode != BinaryWriteMode.OPTIMIZED : "OptimizedMarshaller should not be used
here: " + cls.getName();
 
         Object res;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/301e7a1a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
index 30e0458..b037945 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
@@ -154,6 +154,9 @@ public enum BinaryWriteMode {
     OBJECT(GridBinaryMarshaller.OBJ),
 
     /** */
+    OPTIMIZED(GridBinaryMarshaller.OBJ),
+
+    /** */
     EXCLUSION(GridBinaryMarshaller.OBJ);
 
     /** Type ID. */


Mime
View raw message