ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [34/50] [abbrv] incubator-ignite git commit: ignite-624 - minor
Date Thu, 09 Apr 2015 10:13:32 GMT
ignite-624 - minor


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

Branch: refs/heads/ignite-673
Commit: ab2fe77642294b9cfb432ed43ad41bf320503839
Parents: e0d88d3
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Wed Apr 8 14:28:24 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Wed Apr 8 14:28:24 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/util/lang/GridFunc.java  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab2fe776/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 fee53ef..c7574f3 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
@@ -5433,8 +5433,18 @@ public class GridFunc {
      * @param it Iterable to fetch.
      * @return Modified target collection.
      */
+    @SuppressWarnings("unchecked")
     public static <T, C extends Collection<T>> C addAll(C c, Iterable<? extends
T> it) {
-        return it == null ? c : addAll(c, it.iterator());
+        if (it == null)
+            return c;
+
+        if (it instanceof Collection<?>) {
+            c.addAll((Collection<? extends T>)it);
+
+            return c;
+        }
+
+        return addAll(c, it.iterator());
     }
 
     /**


Mime
View raw message