ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [16/22] ignite git commit: IGNITE-1770: Reader refactoring: removing unused raw flags.
Date Mon, 26 Oct 2015 12:57:59 GMT
IGNITE-1770: Reader refactoring: removing unused raw flags.


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

Branch: refs/heads/ignite-1770
Commit: 81b64f0ee1038c7e8ab6f243d6a0a8549011c7ee
Parents: 8fc0407
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Oct 26 13:50:35 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Oct 26 13:50:35 2015 +0300

----------------------------------------------------------------------
 .../internal/portable/PortableReaderExImpl.java | 29 +++++++++-----------
 1 file changed, 13 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/81b64f0e/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
index 2426004..dc1819e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
@@ -855,7 +855,7 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
                 else
                     doReadClass();
 
-                return doReadEnumArray(false, cls);
+                return doReadEnumArray(cls);
             }
             else if (flag == Flag.HANDLE)
                 return readHandleField();
@@ -1342,7 +1342,7 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
 
         Class cls = doReadClass();
 
-        return (T)doReadEnum(true, cls);
+        return (T)doReadEnum(cls);
     }
 
     /** {@inheritDoc} */
@@ -1358,7 +1358,7 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
 
         Class cls = doReadClass();
 
-        return (T[])doReadEnumArray(true, cls);
+        return (T[])doReadEnumArray(cls);
     }
 
     /**
@@ -1553,13 +1553,13 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
                 return doReadMapEntry(raw, false);
 
             case PORTABLE_OBJ:
-                return doReadPortableObject(raw);
+                return doReadPortableObject();
 
             case ENUM:
-                return doReadEnum(raw, doReadClass());
+                return doReadEnum(doReadClass());
 
             case ENUM_ARR:
-                return doReadEnumArray(raw, doReadClass());
+                return doReadEnumArray(doReadClass());
 
             case CLASS:
                 return in.readInt();
@@ -1877,7 +1877,7 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
                 break;
 
             case PORTABLE_OBJ:
-                obj = doReadPortableObject(true);
+                obj = doReadPortableObject();
 
                 ((PortableObjectImpl)obj).context(ctx);
 
@@ -1887,12 +1887,12 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
                 break;
 
             case ENUM:
-                obj = doReadEnum(true, doReadClass());
+                obj = doReadEnum(doReadClass());
 
                 break;
 
             case ENUM_ARR:
-                obj = doReadEnumArray(true, doReadClass());
+                obj = doReadEnumArray(doReadClass());
 
                 break;
 
@@ -2407,10 +2407,9 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
     }
 
     /**
-     * @param raw Raw flag.
      * @return Value.
      */
-    private PortableObject doReadPortableObject(boolean raw) {
+    private PortableObject doReadPortableObject() {
         if (in.offheapPointer() > 0) {
             int len = in.readInt();
 
@@ -2431,11 +2430,10 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
     }
 
     /**
-     * @param raw Raw flag.
      * @param cls Enum class.
      * @return Value.
      */
-    private Enum<?> doReadEnum(boolean raw, Class<?> cls) throws PortableException
{
+    private Enum<?> doReadEnum(Class<?> cls) throws PortableException {
         if (!cls.isEnum())
             throw new PortableException("Class does not represent enum type: " + cls.getName());
 
@@ -2445,11 +2443,10 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
     }
 
     /**
-     * @param raw Raw flag.
      * @param cls Enum class.
      * @return Value.
      */
-    private Object[] doReadEnumArray(boolean raw, Class<?> cls) throws PortableException
{
+    private Object[] doReadEnumArray(Class<?> cls) throws PortableException {
         int len = in.readInt();
 
         Object[] arr = (Object[])Array.newInstance(cls, len);
@@ -2460,7 +2457,7 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
             if (flag == NULL)
                 arr[i] = null;
             else
-                arr[i] = doReadEnum(raw, doReadClass());
+                arr[i] = doReadEnum(doReadClass());
         }
 
         return arr;


Mime
View raw message