ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [30/50] [abbrv] incubator-ignite git commit: # ignite-1 Do not allow null value for MutableEntry.setValue
Date Mon, 19 Jan 2015 14:21:07 GMT
# ignite-1 Do not allow null value for MutableEntry.setValue


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

Branch: refs/heads/ignite-54
Commit: 83fb794691f1a51fa643ab8d4cfc72a9e30be0f0
Parents: 018a9b0
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Jan 14 10:46:41 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Jan 14 10:46:41 2015 +0300

----------------------------------------------------------------------
 .../grid/kernal/processors/cache/CacheInvokeEntry.java        | 3 +++
 .../distributed/dht/GridCacheAtomicNearCacheSelfTest.java     | 1 +
 .../processors/hadoop/jobtracker/GridHadoopJobTracker.java    | 7 ++++++-
 3 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83fb7946/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
index 1f3900d..c9ca244 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheInvokeEntry.java
@@ -47,6 +47,9 @@ public class CacheInvokeEntry<K, V> implements MutableEntry<K,
V> {
 
     /** {@inheritDoc} */
     @Override public void setValue(V val) {
+        if (val == null)
+            throw new NullPointerException();
+
         this.val = val;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83fb7946/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
index ab2024a..5f240fe 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
@@ -802,6 +802,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest
{
             this.newVal = newVal;
         }
 
+        /** {@inheritDoc} */
         @Override public Void process(MutableEntry<Integer, Integer> e, Object... args)
{
             e.setValue(newVal);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83fb7946/modules/hadoop/src/main/java/org/gridgain/grid/kernal/processors/hadoop/jobtracker/GridHadoopJobTracker.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/gridgain/grid/kernal/processors/hadoop/jobtracker/GridHadoopJobTracker.java
b/modules/hadoop/src/main/java/org/gridgain/grid/kernal/processors/hadoop/jobtracker/GridHadoopJobTracker.java
index 6b3260f..4dcf5a6 100644
--- a/modules/hadoop/src/main/java/org/gridgain/grid/kernal/processors/hadoop/jobtracker/GridHadoopJobTracker.java
+++ b/modules/hadoop/src/main/java/org/gridgain/grid/kernal/processors/hadoop/jobtracker/GridHadoopJobTracker.java
@@ -1583,7 +1583,12 @@ public class GridHadoopJobTracker extends GridHadoopComponent {
 
         /** {@inheritDoc} */
         @Override public Void process(MutableEntry<GridHadoopJobId, GridHadoopJobMetadata>
e, Object... args) {
-            e.setValue(apply(e.getValue()));
+            GridHadoopJobMetadata val = apply(e.getValue());
+
+            if (val != null)
+                e.setValue(val);
+            else
+                e.remove();;
 
             return null;
         }


Mime
View raw message