You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/04/08 15:22:59 UTC
[44/50] incubator-ignite git commit: ignite-624 - minor
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-366
Commit: ab2fe77642294b9cfb432ed43ad41bf320503839
Parents: e0d88d3
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Apr 8 14:28:24 2015 +0300
Committer: S.Vladykin <sv...@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());
}
/**