ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/8] ignite git commit: IGNITE-2263: Removed F.transform(array).
Date Wed, 30 Dec 2015 09:52:21 GMT
IGNITE-2263: Removed F.transform(array).


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

Branch: refs/heads/ignite-2263
Commit: 503be6a569b5392e694653a5e88f7b4dfbda2aae
Parents: ec56380
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Dec 30 12:24:21 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Dec 30 12:24:21 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgniteKernal.java    | 12 ++++++++++--
 .../apache/ignite/internal/util/lang/GridFunc.java  | 15 ---------------
 .../IpcSharedMemoryCrashDetectionSelfTest.java      | 16 ++++++++++------
 3 files changed, 20 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/503be6a5/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 6bff560..7fc0313 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -589,8 +589,16 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
     @Override public List<String> getLifecycleBeansFormatted() {
         LifecycleBean[] beans = cfg.getLifecycleBeans();
 
-        return F.isEmpty(beans) ? Collections.<String>emptyList() :
-            (List<String>)F.transform(beans, F.<LifecycleBean>string());
+        if (F.isEmpty(beans))
+            return Collections.emptyList();
+        else {
+            List<String> res = new ArrayList<>(beans.length);
+
+            for (LifecycleBean bean : beans)
+                res.add(String.valueOf(bean));
+
+            return res;
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/503be6a5/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 dc393d7..4a62f1f 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
@@ -2883,21 +2883,6 @@ public class GridFunc {
     }
 
     /**
-     * Transforms an array to read only collection using provided closure.
-     *
-     * @param c Initial array to transform.
-     * @param f Closure to use for transformation.
-     * @param <X> Type of the free variable for the closure and type of the array elements.
-     * @param <Y> Type of the closure's return value.
-     * @return Transformed read only collection.
-     */
-    public static <X, Y> Collection<Y> transform(X[] c, IgniteClosure<? super
X, Y> f) {
-        A.notNull(c, "c", f, "f");
-
-        return viewReadOnly(asList(c), f);
-    }
-
-    /**
      * Tests if all provided predicates evaluate to {@code true} for given value. Note that
      * evaluation will be short-circuit when first predicate evaluated to {@code false} is
found.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/503be6a5/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
index 1aae999..3482fd6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
@@ -517,12 +517,16 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes
          * @param shmemIds Shared memory IDs string.
          */
         public void shmemIds(String shmemIds) {
-            this.shmemIds = (shmemIds == null) ? null :
-                F.transform(shmemIds.split(","), new C1<String, Integer>() {
-                    @Override public Integer apply(String s) {
-                        return Long.valueOf(s).intValue();
-                    }
-                });
+            if (shmemIds == null)
+                this.shmemIds = null;
+            else {
+                String[] tokens = shmemIds.split(",");
+
+                this.shmemIds = new ArrayList<>(tokens.length);
+
+                for (String token : tokens)
+                    this.shmemIds.add(Long.valueOf(token).intValue());
+            }
         }
     }
 }
\ No newline at end of file


Mime
View raw message