ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [6/9] incubator-ignite git commit: # ignite-47 Cleanup code. (cherry picked from commit 4d816eb)
Date Wed, 11 Mar 2015 15:36:21 GMT
# ignite-47 Cleanup code.
(cherry picked from commit 4d816eb)


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

Branch: refs/heads/sprint-2
Commit: 330a7057ffbdd0f83a308cd336656b6aaedbfbb7
Parents: e556951
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Sat Mar 7 20:14:12 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed Mar 11 18:34:06 2015 +0300

----------------------------------------------------------------------
 .../closure/GridClosureProcessor.java           | 27 ++++++++++----------
 .../processors/resource/GridResourceIoc.java    | 13 +++++-----
 .../ignite/internal/util/lang/GridFunc.java     |  2 +-
 3 files changed, 20 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/330a7057/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index 092ced5..f1558b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -414,7 +414,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
 
-            return ctx.task().execute(new T5<>(node, job), null, false);
+            return ctx.task().execute(new T5(node, job), null, false);
         }
         catch (IgniteCheckedException e) {
             return ComputeTaskInternalFuture.finishedFuture(ctx, T5.class, e);
@@ -566,7 +566,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
 
-            return ctx.task().execute(new T8<>(job, arg), null, false);
+            return ctx.task().execute(new T8(job, arg), null, false);
         }
         finally {
             busyLock.readUnlock();
@@ -589,7 +589,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
 
-            return ctx.task().execute(new T11<>(job, arg, nodes), null, false);
+            return ctx.task().execute(new T11<>(job, arg), null, false);
         }
         finally {
             busyLock.readUnlock();
@@ -613,7 +613,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
             ctx.task().setThreadContext(TC_NO_FAILOVER, true);
 
-            return ctx.task().execute(new T11<>(job, arg, nodes), null, false);
+            return ctx.task().execute(new T11<>(job, arg), null, false);
         }
         finally {
             busyLock.readUnlock();
@@ -1210,7 +1210,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
     /**
      */
-    private class T4 extends TaskNoReduceAdapter<Void> {
+    private static class T4 extends TaskNoReduceAdapter<Void> {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -1241,7 +1241,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
     /**
      */
-    private class T5<R> extends GridPeerDeployAwareTaskAdapter<Void, R> {
+    private static class T5<R> extends GridPeerDeployAwareTaskAdapter<Void, R>
{
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -1365,7 +1365,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
     /**
      */
-    private class T8<T, R> extends GridPeerDeployAwareTaskAdapter<Void, R> {
+    private static class T8<T, R> extends GridPeerDeployAwareTaskAdapter<Void, R>
{
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -1539,9 +1539,8 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param job Job.
          * @param arg Job argument.
-         * @param nodes Collection of nodes.
          */
-        private T11(IgniteClosure<T, R> job, @Nullable T arg, Collection<ClusterNode>
nodes) {
+        private T11(IgniteClosure<T, R> job, @Nullable T arg) {
             super(U.peerDeployAware(job));
 
             this.job = job;
@@ -1648,7 +1647,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
          * @param job Job.
          * @param arg Argument.
          */
-        public C1MLA(IgniteClosure<T, R> job, T arg) {
+        private C1MLA(IgniteClosure<T, R> job, T arg) {
             super(job, arg);
         }
 
@@ -1683,7 +1682,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param c Callable.
          */
-        public C2(Callable<R> c) {
+        private C2(Callable<R> c) {
             this.c = c;
         }
 
@@ -1735,7 +1734,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param c Callable.
          */
-        public C2MLA(Callable<R> c) {
+        private C2MLA(Callable<R> c) {
             super(c);
         }
 
@@ -1769,7 +1768,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param r Runnable.
          */
-        public C4(Runnable r) {
+        private C4(Runnable r) {
             this.r = r;
         }
 
@@ -1818,7 +1817,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param r Runnable.
          */
-        public C4MLA(Runnable r) {
+        private C4MLA(Runnable r) {
             super(r);
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/330a7057/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
index e86dde9..de1ce60 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
@@ -233,16 +233,15 @@ class GridResourceIoc {
 
         GridResourceMethod[] mtds = getMethodsWithAnnotation(dep, targetCls, annCls);
 
-        if (mtds.length == 0) {
-            if (skipClss == null)
-                skipClss = F.addIfAbsent(skipCache, annCls, F.<Class<?>>newCSet());
+        if (mtds.length > 0)
+            return true;
 
-            skipClss.add(targetCls);
+        if (skipClss == null)
+            skipClss = F.addIfAbsent(skipCache, annCls, F.<Class<?>>newCSet());
 
-            return false;
-        }
+        skipClss.add(targetCls);
 
-        return true;
+        return false;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/330a7057/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index 23c9202..2ba821f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -5440,7 +5440,7 @@ public class GridFunc {
      *      does not exist in the map. Return {@code null} if key is not found and
      *      closure is {@code null}.
      */
-    @Nullable public static <K, V>  V addIfAbsent(ConcurrentMap<K, V> map, K
key, @Nullable Callable<V> c) {
+    public static <K, V>  V addIfAbsent(ConcurrentMap<K, V> map, K key, @Nullable
Callable<V> c) {
         A.notNull(map, "map", key, "key");
 
         V v = map.get(key);


Mime
View raw message