Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Fedorov2021-07-21 05:50:02 -0400
committerAlexander Kurtakov2021-07-21 09:06:18 -0400
commitb5e22c9e83cfb9a40192f9c4a5ebb12de06ddc5a (patch)
tree5b2ab7e6996f7a84ba9b9329b9c8bf6ef2c43be9
parentd4a8ee75b789c10599f8f9c028fe6cec9c7f5e3f (diff)
downloadeclipse.platform.team-Y20210722-0800.tar.gz
eclipse.platform.team-Y20210722-0800.tar.xz
eclipse.platform.team-Y20210722-0800.zip
Added type parameter for collections where appropriate Change-Id: Ie65f5e2d86243bab04c0c5ecb2e5af609c82a456 Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.team/+/183226 Tested-by: Platform Bot <platform-bot@eclipse.org>
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java6
10 files changed, 19 insertions, 20 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java
index ced6d3bec..3be899dfe 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java
@@ -142,7 +142,7 @@ public class TeamCapabilityHelper {
return;
IActivityManager activityManager = workbenchActivitySupport
.getActivityManager();
- Set activities = new HashSet<>(activityManager.getEnabledActivityIds());
+ Set<String> activities = new HashSet<>(activityManager.getEnabledActivityIds());
boolean changed = false;
IPluginContribution contribution = providerIdToPluginId.get(id);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
index 01580ddd6..1acd5adf0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
@@ -245,11 +245,11 @@ public class FlatModelProvider extends SynchronizeModelProvider {
protected IDiffElement[] buildModelObjects(ISynchronizeModelElement node) {
if (node == getModelRoot());
SyncInfo[] infos = getSyncInfoSet().getSyncInfos();
- List result = new ArrayList();
+ List<IDiffElement> result = new ArrayList<>();
for (SyncInfo info : infos) {
result.add(createModelObject(node, info));
}
- return (IDiffElement[]) result.toArray(new IDiffElement[result.size()]);
+ return result.toArray(new IDiffElement[result.size()]);
}
@Override
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java
index 9203e1f25..f94339809 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshElementSelectionPage.java
@@ -245,7 +245,7 @@ public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
*/
public Object[] getRootElement() {
TreeItem[] item = fViewer.getTree().getItems();
- List checked = new ArrayList();
+ List<Object> checked = new ArrayList<>();
for (TreeItem child : item) {
collectCheckedItems(child, checked);
}
@@ -341,7 +341,7 @@ public abstract class GlobalRefreshElementSelectionPage extends WizardPage {
protected abstract boolean checkWorkingSetElements();
- private void collectCheckedItems(TreeItem item, List checked) {
+ private void collectCheckedItems(TreeItem item, List<Object> checked) {
if(item.getChecked() && !item.getGrayed()) {
checked.add(item.getData());
} else if(item.getGrayed()) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java
index 0750c74cb..390ad1f79 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/GlobalRefreshResourceSelectionPage.java
@@ -59,7 +59,7 @@ public class GlobalRefreshResourceSelectionPage extends GlobalRefreshElementSele
@Override
public Object[] getChildren(Object element) {
if(element instanceof List) {
- return ((List)element).toArray(new IResource[((List)element).size()]);
+ return ((List<?>)element).toArray(new IResource[((List)element).size()]);
}
return super.getChildren(element);
}
@@ -123,7 +123,7 @@ public class GlobalRefreshResourceSelectionPage extends GlobalRefreshElementSele
@Override
protected boolean checkWorkingSetElements() {
- List allWorkingSetResources = new ArrayList();
+ List<IResource> allWorkingSetResources = new ArrayList<>();
IWorkingSet[] workingSets = getWorkingSets();
for (IWorkingSet set : workingSets) {
allWorkingSetResources.addAll(IDE.computeSelectedResources(new StructuredSelection(set.getElements())));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
index e4426e714..3db08cd12 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
@@ -25,7 +25,7 @@ import org.eclipse.team.internal.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.internal.ui.synchronize.RefreshParticipantJob.IChangeDescription;
public class RefreshChangeListener implements ISubscriberChangeListener, IChangeDescription {
- private List changes = new ArrayList();
+ private List<ISubscriberChangeEvent> changes = new ArrayList<>();
private SubscriberSyncInfoCollector collector;
private IResource[] resources;
@@ -42,16 +42,15 @@ public class RefreshChangeListener implements ISubscriberChangeListener, IChange
}
}
public SyncInfo[] getChanges() {
- List changedSyncInfos = new ArrayList();
+ List<SyncInfo> changedSyncInfos = new ArrayList<>();
SyncInfoSet set = collector.getSyncInfoSet();
- for (Object change : changes) {
- ISubscriberChangeEvent delta = (ISubscriberChangeEvent) change;
+ for (ISubscriberChangeEvent delta : changes) {
SyncInfo info = set.getSyncInfo(delta.getResource());
if (info != null && interestingChange(info)) {
changedSyncInfos.add(info);
}
}
- return (SyncInfo[]) changedSyncInfos.toArray(new SyncInfo[changedSyncInfos.size()]);
+ return changedSyncInfos.toArray(new SyncInfo[changedSyncInfos.size()]);
}
private boolean interestingChange(SyncInfo info) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java
index 43542dfd9..0d0ba9d04 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SaveablesCompareEditorInput.java
@@ -103,7 +103,7 @@ public class SaveablesCompareEditorInput extends CompareEditorInput implements
private ITypedElement fRightElement;
private final IWorkbenchPage page;
- private final ListenerList inputChangeListeners = new ListenerList(
+ private final ListenerList<ICompareInputChangeListener> inputChangeListeners = new ListenerList<>(
ListenerList.IDENTITY);
private ICompareInputChangeListener compareInputChangeListener;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
index f70ecfb4a..80c5d9c24 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/CopyToClipboardAction.java
@@ -177,7 +177,7 @@ class CopyToClipboardAction extends SelectionListenerAction {
private void setClipboard(IResource[] resources, String[] fileNames, String names) {
try {
// set the clipboard contents
- List data = new ArrayList();
+ List<Object> data = new ArrayList<>();
List<Transfer> dataTypes = new ArrayList<>();
if (resources.length > 0) {
data.add(resources);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
index 3aed1da86..6f1cf63d8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java
@@ -35,7 +35,7 @@ import org.eclipse.ui.actions.ActionGroup;
public class DirectionFilterActionGroup extends ActionGroup implements IPropertyChangeListener {
// The list of created actions
- private List actions = new ArrayList(3);
+ private List<DirectionFilterAction> actions = new ArrayList<>(3);
// The modes
private DirectionFilterAction incomingMode;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
index 08736cf62..a3a1ef280 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
@@ -184,7 +184,7 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
showAllToggle.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- ArrayList all = new ArrayList(Arrays.asList(wizards.getChildren()));
+ ArrayList<Object> all = new ArrayList<>(Arrays.asList(wizards.getChildren()));
if(showAllToggle.getSelection()) {
all.addAll(Arrays.asList(disabledWizards.getChildren()));
}
@@ -195,7 +195,7 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
if(wizards.size() == 0 && showAllToggle != null) {
showAllToggle.setSelection(true);
- ArrayList all = new ArrayList(Arrays.asList(wizards.getChildren()));
+ ArrayList<Object> all = new ArrayList<>(Arrays.asList(wizards.getChildren()));
all.addAll(Arrays.asList(disabledWizards.getChildren()));
viewer.setInput(new AdaptableList(all));
} else {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java
index 5e6d7317a..01d853fe0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeScope.java
@@ -45,7 +45,7 @@ public abstract class AbstractSynchronizeScope implements ISynchronizeScope {
/*
* Scope change listeners
*/
- private ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
+ private ListenerList<IPropertyChangeListener> listeners = new ListenerList<>(ListenerList.IDENTITY);
/**
* Save the scope to the given memento
@@ -193,11 +193,11 @@ public abstract class AbstractSynchronizeScope implements ISynchronizeScope {
* @since 3.2
*/
public ResourceMapping[] getMappings() {
- List result = new ArrayList();
+ List<ResourceMapping> result = new ArrayList<>();
IResource[] roots = getRoots();
for (IResource resource : roots) {
result.add(resource.getAdapter(ResourceMapping.class));
}
- return (ResourceMapping[]) result.toArray(new ResourceMapping[result.size()]);
+ return result.toArray(new ResourceMapping[result.size()]);
}
}

Back to the top