ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [20/50] [abbrv] incubator-ignite git commit: Ignite-107 minor code format
Date Tue, 27 Jan 2015 11:41:19 GMT
Ignite-107 minor code format


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

Branch: refs/heads/ignite-59
Commit: eefcf2559de38883ab272186356fef8094e410ce
Parents: d00486f
Author: avinogradov <avinogradov@gridgain.com>
Authored: Mon Jan 26 14:06:16 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Mon Jan 26 14:06:16 2015 +0300

----------------------------------------------------------------------
 .../closure/GridClosureProcessor.java           | 25 +++++++-------------
 1 file changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eefcf255/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 168e102..6246bcb 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
@@ -969,7 +969,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
      * @param arg Optional argument.
      * @return Job.
      */
-    private <T, R> ComputeJob job(final IgniteClosure<T, R> job, @Nullable final
T arg) {
+    private static <T, R> ComputeJob job(final IgniteClosure<T, R> job, @Nullable
final T arg) {
         A.notNull(job, "job");
 
         return job instanceof ComputeJobMasterLeaveAware ? new C1MLA<>(job, arg) :
new C1<>(job, arg);
@@ -981,12 +981,10 @@ public class GridClosureProcessor extends GridProcessorAdapter {
      * @param c Closure to convert to grid job.
      * @return Grid job made out of closure.
      */
-    private <R> ComputeJob job(final Callable<R> c) {
+    private static <R> ComputeJob job(final Callable<R> c) {
         A.notNull(c, "job");
 
-        if (c instanceof ComputeJobMasterLeaveAware)
-            return new C2MLA<>(c);
-        else return new C2<>(c);
+        return c instanceof ComputeJobMasterLeaveAware ? new C2MLA<>(c) : new C2<>(c);
     }
 
     /**
@@ -997,12 +995,11 @@ public class GridClosureProcessor extends GridProcessorAdapter {
      * @param affKey Affinity key.
      * @return Grid job made out of closure.
      */
-    private <R> ComputeJob job(final Callable<R> c, @Nullable final String cacheName,
final Object affKey) {
+    private static <R> ComputeJob job(final Callable<R> c, @Nullable final String
cacheName, final Object affKey) {
         A.notNull(c, "job");
 
-        if (c instanceof ComputeJobMasterLeaveAware)
-            return new C3MLA<>(c, cacheName, affKey);
-        else return new C3<>(c, cacheName, affKey);
+        return c instanceof ComputeJobMasterLeaveAware ? new C3MLA<>(c, cacheName,
affKey) :
+            new C3<>(c, cacheName, affKey);
     }
 
     /**
@@ -1014,9 +1011,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     private static ComputeJob job(final Runnable r) {
         A.notNull(r, "job");
 
-        if (r instanceof ComputeJobMasterLeaveAware)
-            return new C4MLA(r);
-        else  return new C4(r);
+       return r instanceof ComputeJobMasterLeaveAware ? new C4MLA(r) : new C4(r);
     }
 
     /**
@@ -1027,12 +1022,10 @@ public class GridClosureProcessor extends GridProcessorAdapter {
      * @param affKey Affinity key.
      * @return Grid job made out of closure.
      */
-    private ComputeJob job(final Runnable r, @Nullable final String cacheName, final Object
affKey) {
+    private static ComputeJob job(final Runnable r, @Nullable final String cacheName, final
Object affKey) {
         A.notNull(r, "job");
 
-        if (r instanceof ComputeJobMasterLeaveAware)
-            return new C5MLA(r, cacheName, affKey);
-        else return new C5(r, cacheName, affKey);
+        return r instanceof ComputeJobMasterLeaveAware ? new C5MLA(r, cacheName, affKey)
: new C5(r, cacheName, affKey);
     }
 
     /** */


Mime
View raw message