ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [06/13] incubator-ignite git commit: # ignite-51 review
Date Thu, 05 Mar 2015 13:54:56 GMT
# ignite-51 review


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

Branch: refs/heads/ignite-51
Commit: 91253f50b9c18acf1b01eaf0f7da6bebcf50e34f
Parents: ce37315
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Mar 5 12:20:30 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Mar 5 12:20:30 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheInvokeEntry.java        | 18 +++---------------
 .../internal/processors/cache/CacheLazyEntry.java |  7 +++++--
 .../processors/cache/GridCacheMapEntry.java       |  2 +-
 3 files changed, 9 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/91253f50/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
index d87cd3e..b9e89d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import org.apache.ignite.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 
 import javax.cache.processor.*;
@@ -33,19 +32,19 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K,
V> implements Muta
     private Operation op = Operation.NONE;
 
     /**
-     * @param cctx   Cache context.
+     * @param cctx Cache context.
      * @param keyObj Key cache object.
      * @param valObj Cache object value.
      */
     public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj)
{
         super(cctx, keyObj, valObj);
 
-        this.hadVal = getValue() != null;
+        this.hadVal = valObj != null;
     }
 
     /** {@inheritDoc} */
     @Override public boolean exists() {
-        return getValue() != null;
+        return val != null || valObj != null;
     }
 
     /** {@inheritDoc} */
@@ -69,17 +68,6 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K,
V> implements Muta
         op = hadVal ? Operation.UPDATE : Operation.CREATE;
     }
 
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override public <T> T unwrap(Class<T> cls) {
-        if (cls.isAssignableFrom(Ignite.class))
-            return (T)cctx.kernalContext().grid();
-        else if (cls.isAssignableFrom(getClass()))
-            return cls.cast(this);
-
-        throw new IllegalArgumentException("Unwrapping to class is not supported: " + cls);
-    }
-
     /**
      * @return {@code True} if {@link #setValue} or {@link #remove was called}.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/91253f50/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
index 29d04ce..07f38cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
@@ -17,13 +17,14 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 
 import javax.cache.*;
 
 /**
- * 
+ *
  */
 public class CacheLazyEntry<K, V> implements Cache.Entry<K, V> {
     /** Cache context. */
@@ -84,7 +85,9 @@ public class CacheLazyEntry<K, V> implements Cache.Entry<K, V>
{
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <T> T unwrap(Class<T> cls) {
-        if(cls.isAssignableFrom(getClass()))
+        if (cls.isAssignableFrom(Ignite.class))
+            return (T)cctx.kernalContext().grid();
+        else if (cls.isAssignableFrom(getClass()))
             return cls.cast(this);
 
         throw new IllegalArgumentException("Unwrapping to class is not supported: " + cls);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/91253f50/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 930e192..9e17cc5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1002,7 +1002,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx
{
 
         boolean intercept = cctx.config().getInterceptor() != null;
 
-        Object val0 = null;
+        Object val0;
 
         synchronized (this) {
             checkObsolete();


Mime
View raw message