summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java
index 5a01eae9b5..e6100e225d 100644
--- a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java
+++ b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java
@@ -43,6 +43,7 @@
package org.eclipse.jgit.lib;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@@ -50,8 +51,7 @@ public class Sets {
@SafeVarargs
public static <T> Set<T> of(T... elements) {
Set<T> ret = new HashSet<>();
- for (T element : elements)
- ret.add(element);
+ ret.addAll(Arrays.asList(elements));
return ret;
}
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java
index 1d9cd78140..d6aead4a52 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java
@@ -49,6 +49,7 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -854,8 +855,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase {
static Set<Attribute> asSet(Attribute... attrs) {
HashSet<Attribute> result = new HashSet<>();
- for (Attribute attr : attrs)
- result.add(attr);
+ result.addAll(Arrays.asList(attrs));
return result;
}