Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui.test/src')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java9
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/TestCommitMessageProviderExtensionFactory.java5
2 files changed, 6 insertions, 8 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index d65c7d503..2551d908e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -160,7 +160,7 @@ public class TestUtil {
BundleContext context = bundle.getBundleContext();
ServiceTracker<BundleLocalization, BundleLocalization> localizationTracker =
- new ServiceTracker<BundleLocalization, BundleLocalization>(
+ new ServiceTracker<>(
context, BundleLocalization.class, null);
localizationTracker.open();
@@ -469,8 +469,7 @@ public class TestUtil {
public static void assertRepositoryContainsFiles(Repository repository,
String[] paths) throws Exception {
Set<String> expectedfiles = new HashSet<>();
- for (String path : paths)
- expectedfiles.add(path);
+ expectedfiles.addAll(Arrays.asList(paths));
try (TreeWalk treeWalk = new TreeWalk(repository)) {
treeWalk.addTree(repository.resolve("HEAD^{tree}"));
treeWalk.setRecursive(true);
@@ -555,7 +554,7 @@ public class TestUtil {
*/
public SWTBotTreeItem[] getProjectItems(SWTBotTree projectExplorerTree,
String... projects) {
- List<SWTBotTreeItem> items = new ArrayList<SWTBotTreeItem>();
+ List<SWTBotTreeItem> items = new ArrayList<>();
for (SWTBotTreeItem item : projectExplorerTree.getAllItems()) {
String itemText = item.getText();
StringTokenizer tok = new StringTokenizer(itemText, " ");
@@ -691,7 +690,7 @@ public class TestUtil {
*/
public static SWTBotTreeItem getNode(SWTBotTreeItem[] nodes, String searchText) {
List<String> texts = new ArrayList<>();
- List<SWTBotTreeItem> matchingItems = new ArrayList<SWTBotTreeItem>();
+ List<SWTBotTreeItem> matchingItems = new ArrayList<>();
for (SWTBotTreeItem item : nodes) {
String text = item.getText();
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/TestCommitMessageProviderExtensionFactory.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/TestCommitMessageProviderExtensionFactory.java
index 24737b531..18393f875 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/TestCommitMessageProviderExtensionFactory.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/TestCommitMessageProviderExtensionFactory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.egit.ui.test.stagview;
+import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
@@ -60,9 +61,7 @@ public class TestCommitMessageProviderExtensionFactory
public void setCommitMessageProviders(
ICommitMessageProvider... newProviders) {
providers.clear();
- for (ICommitMessageProvider p : newProviders) {
- providers.add(p);
- }
+ providers.addAll(Arrays.asList(newProviders));
}
}

Back to the top