You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/01/02 16:34:54 UTC
ignite git commit: IGNITE-2330: Fixing compilation.
Repository: ignite
Updated Branches:
refs/heads/ignite-2330 e4c49bbdd -> a8ab3bb32
IGNITE-2330: Fixing compilation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a8ab3bb3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a8ab3bb3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a8ab3bb3
Branch: refs/heads/ignite-2330
Commit: a8ab3bb32f9a5a380590ed4f680b9bed71774b63
Parents: e4c49bb
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sat Jan 2 18:35:29 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sat Jan 2 18:35:29 2016 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/util/lang/GridFunc.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a8ab3bb3/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 323a2a6..015be5c 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
@@ -1224,6 +1224,21 @@ public class GridFunc {
}
/**
+ * Converts given runnable to an absolute closure.
+ *
+ * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
+ * @return Closure that wraps given runnable. Note that wrapping closure always returns {@code null}.
+ */
+ public static GridAbsClosure as(@Nullable final Runnable r) {
+ return new CA() {
+ @Override public void apply() {
+ if (r != null)
+ r.run();
+ }
+ };
+ }
+
+ /**
* Gets size of the given collection.
*
* @param c Collection.