ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [3/5] incubator-ignite git commit: # ignite-47 Cleanup code.
Date Sat, 07 Mar 2015 19:16:51 GMT
# ignite-47 Cleanup code.


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

Branch: refs/heads/ignite-47
Commit: 4d816eb6f6b25dd9a0b228d46b2df399357d7653
Parents: 8d0d86f
Author: sevdokimov <sergey.evdokimov@jetbrains.com>
Authored: Sat Mar 7 20:14:12 2015 +0300
Committer: sevdokimov <sergey.evdokimov@jetbrains.com>
Committed: Sat Mar 7 20:14:12 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/4d816eb6/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 657539c..aa170ab 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 {
             leaveBusy();
@@ -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 {
             leaveBusy();
@@ -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 {
             leaveBusy();
@@ -1222,7 +1222,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;
 
@@ -1253,7 +1253,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;
 
@@ -1377,7 +1377,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;
 
@@ -1551,9 +1551,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;
@@ -1660,7 +1659,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);
         }
 
@@ -1695,7 +1694,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param c Callable.
          */
-        public C2(Callable<R> c) {
+        private C2(Callable<R> c) {
             this.c = c;
         }
 
@@ -1747,7 +1746,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param c Callable.
          */
-        public C2MLA(Callable<R> c) {
+        private C2MLA(Callable<R> c) {
             super(c);
         }
 
@@ -1781,7 +1780,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          * @param r Runnable.
          */
-        public C4(Runnable r) {
+        private C4(Runnable r) {
             this.r = r;
         }
 
@@ -1830,7 +1829,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/4d816eb6/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/4d816eb6/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 5b99f58..45809c7 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
@@ -5546,7 +5546,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