Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2019-02-12 15:52:58 -0500
committerKarsten Thoms2019-02-14 16:56:38 -0500
commit2cc9927509ad0bc6e1bc97d1d435008c236b7d9b (patch)
treed2341fab202bae6b91ce012b436c8c23fe1cd737
parentd4aa0100abd68b27bb6f7334e48330f73c2ecb91 (diff)
downloadeclipse.platform.team-2cc9927509ad0bc6e1bc97d1d435008c236b7d9b.tar.gz
eclipse.platform.team-2cc9927509ad0bc6e1bc97d1d435008c236b7d9b.tar.xz
eclipse.platform.team-2cc9927509ad0bc6e1bc97d1d435008c236b7d9b.zip
Resolve raw type warningsI20190215-0055
Change-Id: I5a66afa307f4a830c3766c2c54a8ac2a371f90be Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.compare.core/pom.xml2
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java2
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java4
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchConfiguration.java10
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/DifferencesIterator.java4
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java8
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java28
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java15
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java4
-rw-r--r--bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.jsch.core/pom.xml2
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java12
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java2
-rw-r--r--bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.jsch.ui/pom.xml2
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java18
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.team.cvs.core/pom.xml2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java14
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java30
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderSandbox.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java64
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/UpdateContentCachingService.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/pom.xml2
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/pom.xml2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenLogEntryAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenRemoteFileAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceTraversalAction.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/AbstractCommitAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelProviderAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSSubscriberMergeContext.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/MergeSubscriberContext.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelMergeParticipant.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelUpdateOperation.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceChangeSetCapability.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java26
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheBaseContentsOperation.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheTreeContentsOperation.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutToRemoteFolderOperation.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FetchMembersOperation.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/OverrideAndUpdateOperation.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java47
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java55
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java28
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOnlyMergableOperation.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java25
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java17
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java58
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java68
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java56
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java20
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java19
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java37
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/FilteredTagList.java21
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/LocalProjectTagSource.java32
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/MultiFolderTagSource.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/SingleFileTagSource.java22
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagConfigurationDialog.java38
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagContentAssistProcessor.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSource.java51
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceWorkbenchAdapter.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsProjectSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java21
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardFileTypePage.java17
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizard.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizard.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SaveableComparison.java2
-rw-r--r--examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.compare.examples.xml/pom.xml2
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java6
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ChooseMatcherDropDownAction.java4
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/OrderedMatching.java30
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLChildren.java4
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java2
-rw-r--r--tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.team.tests.core/pom.xml2
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java8
138 files changed, 877 insertions, 729 deletions
diff --git a/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
index d7faa734d..9f7897e5a 100644
--- a/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.core
-Bundle-Version: 3.6.300.qualifier
+Bundle-Version: 3.6.400.qualifier
Bundle-Activator: org.eclipse.compare.internal.core.ComparePlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)"
diff --git a/bundles/org.eclipse.compare.core/pom.xml b/bundles/org.eclipse.compare.core/pom.xml
index 648ebe825..3366028df 100644
--- a/bundles/org.eclipse.compare.core/pom.xml
+++ b/bundles/org.eclipse.compare.core/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare.core</artifactId>
- <version>3.6.300-SNAPSHOT</version>
+ <version>3.6.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java
index 07d8dd033..e8c02fbe6 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java
@@ -129,7 +129,7 @@ public class TextLineLCS extends LCS {
* @return the array of TextLine object each corresponding to a line of text
*/
public static TextLine[] getTextLines(String text) {
- List lines = new ArrayList();
+ List<TextLine> lines = new ArrayList<>();
int begin = 0;
int end = getEOL(text, 0);
int lineNum = 0;
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java
index bd99a6d22..4764ef408 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java
@@ -237,9 +237,9 @@ public class PatchBuilder {
}
}
- static class HunkComparator implements Comparator {
+ static class HunkComparator implements Comparator<IHunk> {
@Override
- public int compare(Object arg0, Object arg1) {
+ public int compare(IHunk arg0, IHunk arg1) {
if ((arg0 != null && arg0 instanceof Hunk)
&& (arg1 != null && arg1 instanceof Hunk)) {
Hunk hunk0 = (Hunk) arg0;
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchConfiguration.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchConfiguration.java
index 28ca16da6..e6761b72e 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchConfiguration.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchConfiguration.java
@@ -13,9 +13,7 @@
*******************************************************************************/
package org.eclipse.compare.patch;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
/**
* A patch configuration allows clients to set parameters that control how a
@@ -32,8 +30,8 @@ public class PatchConfiguration {
private int fFuzz;
private boolean fIgnoreWhitespace= false;
private boolean fReverse= false;
- private HashMap properties = new HashMap();
- private List hunkFilters = new ArrayList();
+ private HashMap<String, Object> properties = new HashMap<>();
+ private List<IHunkFilter> hunkFilters = new ArrayList<>();
/**
* Return whether the patch should be reversed when applied.
@@ -154,7 +152,7 @@ public class PatchConfiguration {
* @since org.eclipse.compare.core 3.5
*/
public IHunkFilter[] getHunkFilters() {
- return (IHunkFilter[]) this.hunkFilters.toArray(new IHunkFilter[this.hunkFilters
+ return this.hunkFilters.toArray(new IHunkFilter[this.hunkFilters
.size()]);
}
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/DifferencesIterator.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/DifferencesIterator.java
index b7acdd839..f7f919227 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/DifferencesIterator.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/DifferencesIterator.java
@@ -22,7 +22,7 @@ import java.util.List;
*/
/* package */ class DifferencesIterator {
- List fRange;
+ List<RangeDifference> fRange;
int fIndex;
RangeDifference[] fArray;
RangeDifference fDifference;
@@ -34,7 +34,7 @@ import java.util.List;
this.fArray= differenceRanges;
this.fIndex= 0;
- this.fRange= new ArrayList();
+ this.fRange= new ArrayList<>();
if (this.fIndex < this.fArray.length)
this.fDifference= this.fArray[this.fIndex++];
else
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java
index 03d49c80a..61615a56f 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java
@@ -18,9 +18,7 @@ import java.util.List;
import org.eclipse.compare.internal.core.LCS;
import org.eclipse.compare.internal.core.Messages;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.*;
/* package */ class RangeComparatorLCS extends LCS {
@@ -73,7 +71,7 @@ import org.eclipse.core.runtime.SubMonitor;
public RangeDifference[] getDifferences(SubMonitor subMonitor, AbstractRangeDifferenceFactory factory) {
try {
- List differences = new ArrayList();
+ List<RangeDifference> differences = new ArrayList<>();
int length = getLength();
if (length == 0) {
differences.add(factory.createRangeDifference(RangeDifference.CHANGE, 0, this.comparator2.getRangeCount(), 0, this.comparator1.getRangeCount()));
@@ -131,7 +129,7 @@ import org.eclipse.core.runtime.SubMonitor;
}
}
- return (RangeDifference[]) differences.toArray(new RangeDifference[differences.size()]);
+ return differences.toArray(new RangeDifference[differences.size()]);
} finally {
subMonitor.done();
}
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
index 66fdf25c2..fc88a0956 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
@@ -17,9 +17,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.compare.internal.core.Messages;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.*;
/**
* A <code>RangeDifferencer</code> finds the differences between two or three <code>IRangeComparator</code>s.
@@ -168,7 +166,7 @@ public final class RangeDifferencer {
DifferencesIterator myIter= new DifferencesIterator(rightAncestorScript);
DifferencesIterator yourIter= new DifferencesIterator(leftAncestorScript);
- List diff3= new ArrayList();
+ List<RangeDifference> diff3= new ArrayList<>();
diff3.add(factory.createRangeDifference(RangeDifference.ERROR)); // add a sentinel
int changeRangeStart= 0;
@@ -239,7 +237,7 @@ public final class RangeDifferencer {
// remove sentinel
diff3.remove(0);
- return (RangeDifference[]) diff3.toArray(EMPTY_RESULT);
+ return diff3.toArray(EMPTY_RESULT);
} finally {
if (pm != null)
pm.done();
@@ -289,7 +287,7 @@ public final class RangeDifferencer {
*/
public static RangeDifference[] findRanges(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator left, IRangeComparator right) {
RangeDifference[] in= findDifferences(factory, pm, left, right);
- List out= new ArrayList();
+ List<RangeDifference> out= new ArrayList<>();
RangeDifference rd;
@@ -312,7 +310,7 @@ public final class RangeDifferencer {
if (rd.maxLength() > 0)
out.add(rd);
- return (RangeDifference[]) out.toArray(EMPTY_RESULT);
+ return out.toArray(EMPTY_RESULT);
}
/**
@@ -369,7 +367,7 @@ public final class RangeDifferencer {
return findRanges(factory,pm, left, right);
RangeDifference[] in= findDifferences(factory, pm, ancestor, left, right);
- List out= new ArrayList();
+ List<RangeDifference> out= new ArrayList<>();
RangeDifference rd;
@@ -394,7 +392,7 @@ public final class RangeDifferencer {
if (rd.maxLength() > 0)
out.add(rd);
- return (RangeDifference[]) out.toArray(EMPTY_RESULT);
+ return out.toArray(EMPTY_RESULT);
}
//---- private methods
@@ -403,13 +401,13 @@ public final class RangeDifferencer {
* Creates a <code>RangeDifference3</code> given the
* state of two DifferenceIterators.
*/
- private static RangeDifference createRangeDifference3(AbstractRangeDifferenceFactory configurator, DifferencesIterator myIter, DifferencesIterator yourIter, List diff3,
+ private static RangeDifference createRangeDifference3(AbstractRangeDifferenceFactory configurator, DifferencesIterator myIter, DifferencesIterator yourIter, List<RangeDifference> diff3,
IRangeComparator right, IRangeComparator left, int changeRangeStart, int changeRangeEnd) {
int rightStart, rightEnd;
int leftStart, leftEnd;
int kind= RangeDifference.ERROR;
- RangeDifference last= (RangeDifference) diff3.get(diff3.size() - 1);
+ RangeDifference last= diff3.get(diff3.size() - 1);
Assert.isTrue((myIter.getCount() != 0 || yourIter.getCount() != 0)); // At least one range array must be non-empty
//
@@ -420,8 +418,8 @@ public final class RangeDifferencer {
rightEnd= changeRangeEnd - last.ancestorEnd() + last.rightEnd();
kind= RangeDifference.LEFT;
} else {
- RangeDifference f= (RangeDifference) myIter.fRange.get(0);
- RangeDifference l= (RangeDifference) myIter.fRange.get(myIter.fRange.size() - 1);
+ RangeDifference f= myIter.fRange.get(0);
+ RangeDifference l= myIter.fRange.get(myIter.fRange.size() - 1);
rightStart= changeRangeStart - f.leftStart + f.rightStart;
rightEnd= changeRangeEnd - l.leftEnd() + l.rightEnd();
}
@@ -431,8 +429,8 @@ public final class RangeDifferencer {
leftEnd= changeRangeEnd - last.ancestorEnd() + last.leftEnd();
kind= RangeDifference.RIGHT;
} else {
- RangeDifference f= (RangeDifference) yourIter.fRange.get(0);
- RangeDifference l= (RangeDifference) yourIter.fRange.get(yourIter.fRange.size() - 1);
+ RangeDifference f= yourIter.fRange.get(0);
+ RangeDifference l= yourIter.fRange.get(yourIter.fRange.size() - 1);
leftStart= changeRangeStart - f.leftStart + f.rightStart;
leftEnd= changeRangeEnd - l.leftEnd() + l.rightEnd();
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java
index 6b0864017..20225e77e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java
@@ -61,11 +61,13 @@ public class ChangeCompareFilterPropertyAction extends Action implements
}
}
+ @SuppressWarnings("unchecked")
void setProperty(boolean state) {
if (fCompareConfiguration != null) {
- Map filters = new HashMap();
+ Map<String, ICompareFilter> filters = new HashMap<>();
if (fCompareConfiguration.getProperty(COMPARE_FILTERS) != null) {
- filters.putAll((Map) fCompareConfiguration
+ filters.putAll(
+ (Map<String, ICompareFilter>) fCompareConfiguration
.getProperty(COMPARE_FILTERS));
}
if (state) {
@@ -78,10 +80,12 @@ public class ChangeCompareFilterPropertyAction extends Action implements
}
}
+ @SuppressWarnings("unchecked")
boolean getProperty() {
- Map filters = (Map) fCompareConfiguration.getProperty(COMPARE_FILTERS);
+ Map<String, ICompareFilter> filters = (Map<String, ICompareFilter>) fCompareConfiguration
+ .getProperty(COMPARE_FILTERS);
if (filters == null) {
- filters = new HashMap();
+ filters = new HashMap<>();
}
return filters.containsKey(fCompareFilterDescriptor.getFilterId());
}
@@ -108,11 +112,12 @@ public class ChangeCompareFilterPropertyAction extends Action implements
setChecked(getProperty());
}
+ @SuppressWarnings("unchecked")
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(COMPARE_FILTERS)
&& event.getNewValue() instanceof Map) {
- setChecked(((Map) event.getNewValue())
+ setChecked(((Map<String, ICompareFilter>) event.getNewValue())
.containsKey(fCompareFilterDescriptor.getFilterId()));
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
index b4288fd16..7c5693bc8 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
@@ -156,8 +156,8 @@ public class CompareEditorContributor extends EditorActionBarContributor {
.getProperty(
ChangeCompareFilterPropertyAction.COMPARE_FILTER_ACTIONS);
if (filterActions instanceof List
- && !((List) filterActions).isEmpty()) {
- Iterator i = ((List) filterActions).iterator();
+ && !((List<?>) filterActions).isEmpty()) {
+ Iterator<?> i = ((List<?>) filterActions).iterator();
while (i.hasNext()) {
Object next = i.next();
if (next instanceof ChangeCompareFilterPropertyAction) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
index 7be518128..844e772ba 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
@@ -70,8 +70,7 @@ public class CompareStructureViewerSwitchingPane extends
if (fSelectedViewerDescriptor != null) {
ViewerDescriptor[] array = CompareUIPlugin.getDefault().findStructureViewerDescriptor(
oldViewer, (ICompareInput)input, getCompareConfiguration());
- List list = array != null ? Arrays.asList(array)
- : Collections.EMPTY_LIST;
+ List<ViewerDescriptor> list = array != null ? Arrays.asList(array) : Collections.emptyList();
if (list.contains(fSelectedViewerDescriptor)) {
// use selected viewer only when appropriate for the new input
fCompareEditorInput
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
index fc3f5f8f3..f9afc1a2e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
@@ -22,7 +22,7 @@ import org.eclipse.jface.viewers.Viewer;
* A specialized content provider to show a list of editor parts.
*/
public class ListContentProvider implements IStructuredContentProvider {
- List fContents;
+ List<?> fContents;
public ListContentProvider() {
// nothing to do
@@ -38,7 +38,7 @@ public class ListContentProvider implements IStructuredContentProvider {
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput instanceof List)
- fContents= (List)newInput;
+ fContents = (List<?>) newInput;
else
fContents= null;
// we use a fixed set.
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index fc7a47d62..34f1b86dd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -90,7 +90,7 @@ public class Patcher implements IHunkFilter {
private FilePatch2[] fDiffs;
private IResource fTarget;
// patch options
- private Set disabledElements = new HashSet();
+ private Set<Object> disabledElements = new HashSet<>();
private Map<FilePatch2, FileDiffResult> diffResults = new HashMap<>();
private final Map<FilePatch2, byte[]> contentCache = new HashMap<>();
private Set<Hunk> mergedHunks = new HashSet<>();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
index be4849b5c..591b38335 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
@@ -171,7 +171,7 @@ public class PreviewPatchPage2 extends WizardPage {
private void updateActions(IStructuredSelection ss) {
fExcludeAction.setEnabled(false);
fIncludeAction.setEnabled(false);
- for (Iterator it = ss.iterator(); it.hasNext();) {
+ for (Iterator<?> it = ss.iterator(); it.hasNext();) {
Object element = it.next();
if (element instanceof PatchDiffNode) {
if (((PatchDiffNode) element).isEnabled()) {
@@ -245,7 +245,7 @@ public class PreviewPatchPage2 extends WizardPage {
ISelection selection = fInput.getViewer().getSelection();
if (selection instanceof TreeSelection){
TreeSelection treeSelection = (TreeSelection) selection;
- Iterator iter = treeSelection.iterator();
+ Iterator<?> iter = treeSelection.iterator();
while (iter.hasNext()){
Object obj = iter.next();
if (obj instanceof PatchDiffNode){
@@ -267,7 +267,7 @@ public class PreviewPatchPage2 extends WizardPage {
ISelection selection = fInput.getViewer().getSelection();
if (selection instanceof TreeSelection){
TreeSelection treeSelection = (TreeSelection) selection;
- Iterator iter = treeSelection.iterator();
+ Iterator<?> iter = treeSelection.iterator();
while (iter.hasNext()){
Object obj = iter.next();
if (obj instanceof PatchDiffNode){
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
index 5031ee8eb..10535ba0f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
@@ -52,7 +52,7 @@ public class WorkspacePatcher extends Patcher {
private DiffProject[] fDiffProjects;
private boolean fIsWorkspacePatch= false;
private boolean fIsGitPatch = false;
- private final Map retargetedDiffs = new HashMap();
+ private final Map<Object, IPath> retargetedDiffs = new HashMap<>();
public WorkspacePatcher() {
// nothing to do
@@ -270,7 +270,7 @@ public class WorkspacePatcher extends Patcher {
}
public IPath getOriginalPath(Object object) {
- return (IPath)retargetedDiffs.get(object);
+ return retargetedDiffs.get(object);
}
public void retargetDiff(FilePatch2 diff, IFile file) {
diff --git a/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
index 79af158fb..46d3aefee 100644
--- a/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jsch.core;singleton:=true
-Bundle-Version: 1.3.300.qualifier
+Bundle-Version: 1.3.400.qualifier
Bundle-Activator: org.eclipse.jsch.internal.core.JSchCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jsch.core/pom.xml b/bundles/org.eclipse.jsch.core/pom.xml
index b1c980251..42b43c806 100644
--- a/bundles/org.eclipse.jsch.core/pom.xml
+++ b/bundles/org.eclipse.jsch.core/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.jsch</groupId>
<artifactId>org.eclipse.jsch.core</artifactId>
- <version>1.3.300-SNAPSHOT</version>
+ <version>1.3.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java
index ccb6ee17d..cecf38532 100644
--- a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java
@@ -49,9 +49,9 @@ public class JSchCorePlugin extends Plugin{
public static final String PT_IDENTITYREPOSITORY="identityrepository"; //$NON-NLS-1$
private static JSchCorePlugin plugin;
- private ServiceTracker tracker;
+ private ServiceTracker<?, ?> tracker;
- private ServiceRegistration jschService;
+ private ServiceRegistration<?> jschService;
public JSchCorePlugin(){
plugin=this;
@@ -152,7 +152,7 @@ public class JSchCorePlugin extends Plugin{
if(extensions.length==0)
return new IdentityRepository[0];
- ArrayList tmp = new ArrayList();
+ ArrayList<IdentityRepository> tmp = new ArrayList<>();
for(int i=0; i<extensions.length; i++){
IExtension extension=extensions[i];
IConfigurationElement[] configs=extension.getConfigurationElements();
@@ -183,7 +183,7 @@ public class JSchCorePlugin extends Plugin{
IdentityRepository[] repositories = new IdentityRepository[tmp.size()];
for(int i=0; i<tmp.size(); i++){
- repositories[i]=(IdentityRepository)tmp.get(i);
+ repositories[i]=tmp.get(i);
}
return repositories;
}
@@ -242,12 +242,12 @@ public class JSchCorePlugin extends Plugin{
public void start(BundleContext context) throws Exception{
super.start(context);
- tracker=new ServiceTracker(getBundle().getBundleContext(),
+ tracker=new ServiceTracker<Object, Object>(getBundle().getBundleContext(),
IProxyService.class.getName(), null);
tracker.open();
jschService=getBundle().getBundleContext().registerService(
IJSchService.class.getName(), JSchProvider.getInstance(),
- new Hashtable());
+ new Hashtable<String, Object>());
}
public void stop(BundleContext context) throws Exception{
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
index 063cc9dc0..59bfc814a 100644
--- a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
@@ -128,7 +128,7 @@ public class Utils{
port = IConstants.SSH_DEFAULT_PORT;
Session session=jsch.getSession(username, hostname, port);
setProxy(session);
- Hashtable config=new Hashtable();
+ Hashtable<String, String> config=new Hashtable<>();
config.put("PreferredAuthentications", //$NON-NLS-1$
getEnabledPreferredAuthMethods());
config.put("kex", //$NON-NLS-1$
diff --git a/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
index 85d9ddbb3..f3ccbf55f 100644
--- a/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jsch.ui;singleton:=true
-Bundle-Version: 1.3.300.qualifier
+Bundle-Version: 1.3.400.qualifier
Bundle-Activator: org.eclipse.jsch.internal.ui.JSchUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jsch.ui/pom.xml b/bundles/org.eclipse.jsch.ui/pom.xml
index ddc0b565e..53e001577 100644
--- a/bundles/org.eclipse.jsch.ui/pom.xml
+++ b/bundles/org.eclipse.jsch.ui/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.jsch</groupId>
<artifactId>org.eclipse.jsch.ui</artifactId>
- <version>1.3.300-SNAPSHOT</version>
+ <version>1.3.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
index 62531eb71..9c54a6e36 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/JSchUIPlugin.java
@@ -17,7 +17,11 @@ package org.eclipse.jsch.internal.ui;
import java.net.URL;
import java.util.Hashtable;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jsch.core.IJSchService;
@@ -29,12 +33,12 @@ public class JSchUIPlugin extends AbstractUIPlugin{
public static final String ID="org.eclipse.jsch.ui"; //$NON-NLS-1$
public static final String DECORATOR_ID="org.eclipse.jsch.ui.decorator"; //$NON-NLS-1$
- private static Hashtable imageDescriptors=new Hashtable(20);
+ private static Hashtable<String, ImageDescriptor> imageDescriptors = new Hashtable<>(20);
/**
* The singleton plug-in instance
*/
private static JSchUIPlugin plugin;
- private ServiceTracker tracker;
+ private ServiceTracker<?, ?> tracker;
public JSchUIPlugin(){
super();
@@ -57,7 +61,7 @@ public class JSchUIPlugin extends AbstractUIPlugin{
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String id){
- return (ImageDescriptor)imageDescriptors.get(id);
+ return imageDescriptors.get(id);
}
/**
@@ -92,7 +96,8 @@ public class JSchUIPlugin extends AbstractUIPlugin{
/**
* @see Plugin#start(BundleContext)
*/
- public void start(BundleContext context) throws Exception {
+ @Override
+public void start(BundleContext context) throws Exception {
super.start(context);
initializeImages();
@@ -106,7 +111,8 @@ public class JSchUIPlugin extends AbstractUIPlugin{
tracker.open();
}
- public void stop(BundleContext context) throws Exception{
+ @Override
+public void stop(BundleContext context) throws Exception{
super.stop(context);
tracker.close();
}
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
index 52e5e4fe6..5685e34c0 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
@@ -1066,7 +1066,7 @@ protected Control createContents(Composite parent){
private void populateAuthMethods(){
preferedAuthMethodTable.removeAll();
String[] methods = Utils.getEnabledPreferredAuthMethods().split(","); //$NON-NLS-1$
- Set smethods = new HashSet(Arrays.asList(methods));
+ Set<String> smethods = new HashSet<>(Arrays.asList(methods));
String[] order = Utils.getMethodsOrder().split(","); //$NON-NLS-1$
@@ -1195,7 +1195,7 @@ protected Control createContents(Composite parent){
private void populateKeyExchangeMethods(){
preferedKeyExchangeMethodTable.removeAll();
String[] methods = Utils.getEnabledPreferredKEXMethods().split(","); //$NON-NLS-1$
- Set smethods = new HashSet(Arrays.asList(methods));
+ Set<String> smethods = new HashSet<>(Arrays.asList(methods));
String[] order = Utils.getKEXMethodsOrder().split(","); //$NON-NLS-1$
@@ -1369,7 +1369,7 @@ protected Control createContents(Composite parent){
private void populateMACMethods(){
preferedMACMethodTable.removeAll();
String[] methods = Utils.getEnabledPreferredMACMethods().split(","); //$NON-NLS-1$
- Set smethods = new HashSet(Arrays.asList(methods));
+ Set<String> smethods = new HashSet<>(Arrays.asList(methods));
String[] order = Utils.getMACMethodsOrder().split(","); //$NON-NLS-1$
@@ -1390,7 +1390,7 @@ protected Control createContents(Composite parent){
void removeHostKey(){
IStructuredSelection selection=viewer.getStructuredSelection();
HostKeyRepository hkr=getJSch().getHostKeyRepository();
- for(Iterator iterator=selection.iterator(); iterator.hasNext();){
+ for(Iterator<?> iterator=selection.iterator(); iterator.hasNext();){
HostKey hostkey=(HostKey)iterator.next();
hkr.remove(hostkey.getHost(), hostkey.getType());
viewer.remove(hostkey);
diff --git a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
index 498a5d86b..946317d5f 100644
--- a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.core; singleton:=true
-Bundle-Version: 3.4.400.qualifier
+Bundle-Version: 3.4.500.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.core.CVSProviderPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.team.cvs.core/pom.xml b/bundles/org.eclipse.team.cvs.core/pom.xml
index 5f437dae4..a4d962438 100644
--- a/bundles/org.eclipse.team.cvs.core/pom.xml
+++ b/bundles/org.eclipse.team.cvs.core/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.core</artifactId>
- <version>3.4.400-SNAPSHOT</version>
+ <version>3.4.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
index 91024baba..c91bbef74 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
@@ -117,7 +117,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
private static final String UNIQUE_ID_PREFIX = "merge-"; //$NON-NLS-1$
private CVSTag start, end;
- private List roots;
+ private List<IResource> roots;
private CVSResourceVariantTree remoteTree;
private MergeBaseTree baseTree;
private boolean isModelSync;
@@ -136,7 +136,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
super(id, NLS.bind(CVSMessages.CVSMergeSubscriber_2, new String[] { start.getName(), end.getName() }));
this.start = start;
this.end = end;
- this.roots = new ArrayList(Arrays.asList(roots));
+ this.roots = new ArrayList<>(Arrays.asList(roots));
initialize();
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java
index fd7079f49..d93b040c0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRepositoryLocationMatcher.java
@@ -52,10 +52,10 @@ public class CVSRepositoryLocationMatcher {
return 0;
};
- public static Map/* <IProject, List<ICVSRepositoryLocation>> */prepareSuggestedRepositoryLocations(
- IProject[] projects, final Map/* <IProject, LoadInfo> */infoMap) {
- List/* <IProject> */confirmedProjectsList = Arrays.asList(projects);
- Set/* <ICVSRepositoryLocation> */projectSetRepositoryLocations = new HashSet();
+ public static Map<IProject, List<ICVSRepositoryLocation>> prepareSuggestedRepositoryLocations(
+ IProject[] projects, final Map<IProject, LoadInfo> infoMap) {
+ List<IProject> confirmedProjectsList = Arrays.asList(projects);
+ Set<ICVSRepositoryLocation> projectSetRepositoryLocations = new HashSet<>();
for (Iterator i = infoMap.keySet().iterator(); i.hasNext();) {
IProject project = (IProject) i.next();
if (confirmedProjectsList.contains(project)) {
@@ -69,7 +69,7 @@ public class CVSRepositoryLocationMatcher {
return null;
}
- List/* <ICVSRepositoryLocation> */knownRepositories = Arrays
+ List<ICVSRepositoryLocation> knownRepositories = Arrays
.asList(KnownRepositories.getInstance().getRepositories());
if (knownRepositories.isEmpty()) {
@@ -80,7 +80,7 @@ public class CVSRepositoryLocationMatcher {
.hasNext();) {
ICVSRepositoryLocation projectSetRepositoryLocation = (ICVSRepositoryLocation) i
.next();
- ArrayList list = new ArrayList(1);
+ ArrayList<ICVSRepositoryLocation> list = new ArrayList<>(1);
list.add(projectSetRepositoryLocation);
result.put(projectSetRepositoryLocation, list);
}
@@ -88,7 +88,7 @@ public class CVSRepositoryLocationMatcher {
} else if (knownRepositories.containsAll(projectSetRepositoryLocations)) {
// All repositories are known, no need to prompt for additional
// information.
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
} else {
// Not all repositories from the project set are known.
Map result = new HashMap();
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java
index a6448a423..5c28a5623 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java
@@ -141,8 +141,8 @@ public abstract class CVSSyncTreeSubscriber extends ResourceVariantTreeSubscribe
}
protected boolean rootsEqual(Subscriber other) {
- Set roots1 = new HashSet(Arrays.asList(other.roots()));
- Set roots2 = new HashSet(Arrays.asList(roots()));
+ Set<IResource> roots1 = new HashSet<>(Arrays.asList(other.roots()));
+ Set<IResource> roots2 = new HashSet<>(Arrays.asList(roots()));
if(roots1.size() != roots2.size()) return false;
return roots2.containsAll(roots1);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
index cf1381bd8..918968259 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
@@ -104,7 +104,7 @@ public class Update extends Command {
}
protected LocalOption[] filterLocalOptions(Session session, GlobalOption[] globalOptions, LocalOption[] localOptions) {
- List newOptions = new ArrayList(Arrays.asList(localOptions));
+ List<LocalOption> newOptions = new ArrayList<>(Arrays.asList(localOptions));
if (shouldRetrieveAbsentDirectories(session) && ! RETRIEVE_ABSENT_DIRECTORIES.isElementOf(localOptions)) {
newOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java
index 87c150cfa..b6c537c35 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java
@@ -134,7 +134,7 @@ public class CVSFileHistory extends FileHistory {
} else if (flag == IFileHistoryProvider.SINGLE_LINE_OF_DESCENT) {
CVSTag tempTag = cvsFile.getSyncInfo().getTag();
- ArrayList entriesOfInterest = new ArrayList();
+ ArrayList<ILogEntry> entriesOfInterest = new ArrayList<>();
for (int i = 0; i < entries.length; i++) {
CVSTag[] tags = entries[i].getTags();
for (int j = 0; j < tags.length; j++) {
@@ -260,7 +260,7 @@ public class CVSFileHistory extends FileHistory {
//the predecessor is the file with a timestamp that is the largest timestamp
//from the set of all timestamps smaller than the root file's timestamp
- ArrayList directDescendents = new ArrayList();
+ ArrayList<IFileRevision> directDescendents = new ArrayList<>();
for (int i = 0; i < revisions.length; i++) {
if (((CVSFileRevision) revisions[i]).isDescendentOf(revision)) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
index c25f311e0..56d3f4bdc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
@@ -359,7 +359,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
} else if (notifications == NOTIFY_ON_ALL) {
internalFormat = NotifyInfo.ALL;
} else {
- List notificationCharacters = new ArrayList();
+ List<Character> notificationCharacters = new ArrayList<>();
if ((notifications & NOTIFY_ON_EDIT) >0)
notificationCharacters.add(Character.valueOf(NotifyInfo.EDIT));
if ((notifications & NOTIFY_ON_UNEDIT) >0)
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
index c044d0031..6a94fb5bb 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
@@ -43,7 +43,7 @@ class EclipseFolder extends EclipseResource implements ICVSFolder {
* @see ICVSFolder#members(int)
*/
public ICVSResource[] members(int flags) throws CVSException {
- final List result = new ArrayList();
+ final List<ICVSResource> result = new ArrayList<>();
IResource[] resources = EclipseSynchronizer.getInstance().members((IContainer)resource);
boolean includeFiles = (((flags & FILE_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0));
boolean includeFolders = (((flags & FOLDER_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0));
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index 15a690fb8..13bc02680 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -419,7 +419,7 @@ public class EclipseSynchronizer implements IFlushOperation {
setCachedFolderIgnores(folder, ignores);
SyncFileWriter.writeCVSIgnoreEntries(folder, ignores);
// broadcast changes to unmanaged children - they are the only candidates for being ignored
- List possibleIgnores = new ArrayList();
+ List<IResource> possibleIgnores = new ArrayList<>();
accumulateNonManagedChildren(folder, possibleIgnores);
ResourceStateChangeListeners.getListener().resourceSyncInfoChanged((IResource[])possibleIgnores.toArray(new IResource[possibleIgnores.size()]));
} finally {
@@ -641,7 +641,7 @@ public class EclipseSynchronizer implements IFlushOperation {
if (container.exists()) {
ISchedulingRule rule = null;
try {
- Set changed = new HashSet();
+ Set<IResource> changed = new HashSet<>();
rule = beginBatching(container, null);
try {
beginOperation();
@@ -691,7 +691,7 @@ public class EclipseSynchronizer implements IFlushOperation {
}
public void syncFilesChangedExternally(IContainer[] changedMetaFiles, IFile[] externalDeletions) throws CVSException {
- List changed = new ArrayList();
+ List<IResource> changed = new ArrayList<>();
for (int i = 0; i < changedMetaFiles.length; i++) {
IContainer container = changedMetaFiles[i];
if (!isWithinActiveOperationScope(container)) {
@@ -947,7 +947,7 @@ public class EclipseSynchronizer implements IFlushOperation {
if (threadInfo.isEmpty()) {
return SyncInfoCache.STATUS_OK;
}
- List errors = new ArrayList();
+ List<IStatus> errors = new ArrayList<>();
try {
/*** prepare operation ***/
// find parents of changed resources
@@ -958,7 +958,7 @@ public class EclipseSynchronizer implements IFlushOperation {
} else {
changedFolders = new IContainer[0];
}
- Set dirtyParents = new HashSet();
+ Set<IContainer> dirtyParents = new HashSet<>();
for (int i = 0; i < changedResources.length; i++) {
IResource resource = changedResources[i];
IContainer folder = resource.getParent();
@@ -1018,7 +1018,7 @@ public class EclipseSynchronizer implements IFlushOperation {
// write sync info for all children in one go
try {
beginOperation();
- List infos = new ArrayList();
+ List<byte[]> infos = new ArrayList<>();
IResource[] children = folder.members(true);
for (int i = 0; i < children.length; i++) {
IResource resource = children[i];
@@ -1054,7 +1054,7 @@ public class EclipseSynchronizer implements IFlushOperation {
/*** broadcast events ***/
monitor.subTask(CVSMessages.EclipseSynchronizer_NotifyingListeners);
- Set allChanges = new HashSet();
+ Set<IResource> allChanges = new HashSet<>();
allChanges.addAll(Arrays.asList(changedResources));
allChanges.addAll(Arrays.asList(changedFolders));
allChanges.addAll(dirtyParents);
@@ -1160,11 +1160,11 @@ public class EclipseSynchronizer implements IFlushOperation {
* @param folder the folder to be searched
* @param possibleIgnores the list of IResources that can be ignored
*/
- private void accumulateNonManagedChildren(IContainer folder, List possibleIgnores) throws CVSException {
+ private void accumulateNonManagedChildren(IContainer folder, List<IResource> possibleIgnores) throws CVSException {
try {
cacheResourceSyncForChildren(folder, true /* can modify workspace */);
IResource[] children = folder.members();
- List folders = new ArrayList();
+ List<IResource> folders = new ArrayList<>();
// deal with all files first and then folders to be otimized for caching scheme
for (int i = 0; i < children.length; i++) {
IResource child = children[i];
@@ -1204,7 +1204,7 @@ public class EclipseSynchronizer implements IFlushOperation {
if (info == null) return;
infos = new NotifyInfo[] { info };
} else {
- Map infoMap = new HashMap();
+ Map<String, NotifyInfo> infoMap = new HashMap<>();
for (int i = 0; i < infos.length; i++) {
NotifyInfo notifyInfo = infos[i];
infoMap.put(notifyInfo.getName(), notifyInfo);
@@ -1251,7 +1251,7 @@ public class EclipseSynchronizer implements IFlushOperation {
public void deleteNotifyInfo(IResource resource) throws CVSException {
NotifyInfo[] infos = SyncFileWriter.readAllNotifyInfo(resource.getParent());
if (infos == null) return;
- Map infoMap = new HashMap();
+ Map<String, NotifyInfo> infoMap = new HashMap<>();
for (int i = 0; i < infos.length; i++) {
NotifyInfo notifyInfo = infos[i];
infoMap.put(notifyInfo.getName(), notifyInfo);
@@ -1281,7 +1281,7 @@ public class EclipseSynchronizer implements IFlushOperation {
if (infos == null) {
infos = new BaserevInfo[] { info };
} else {
- Map infoMap = new HashMap();
+ Map<String, BaserevInfo> infoMap = new HashMap<>();
for (int i = 0; i < infos.length; i++) {
infoMap.put(infos[i].getName(), infos[i]);
}
@@ -1320,7 +1320,7 @@ public class EclipseSynchronizer implements IFlushOperation {
public void deleteBaserevInfo(IResource resource) throws CVSException {
BaserevInfo[] infos = SyncFileWriter.readAllBaserevInfo(resource.getParent());
if (infos == null) return;
- Map infoMap = new HashMap();
+ Map<String, BaserevInfo> infoMap = new HashMap<>();
for (int i = 0; i < infos.length; i++) {
infoMap.put(infos[i].getName(), infos[i]);
}
@@ -1434,7 +1434,7 @@ public class EclipseSynchronizer implements IFlushOperation {
* thats were the sync info is kept.
*/
private IContainer[] getParentFolders(IResource[] resources, int depth) throws CVSException {
- final Set folders = new HashSet();
+ final Set<IResource> folders = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
folders.add(resource.getProject());
@@ -1820,7 +1820,7 @@ public class EclipseSynchronizer implements IFlushOperation {
}
private ISchedulingRule getProjectRule(IResource[] resources) {
- HashSet set = new HashSet();
+ HashSet<IProject> set = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
set.add(resource.getProject());
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService.java
index 4bfb0843b..3a7a14268 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService.java
@@ -121,7 +121,7 @@ public class FileContentCachingService {
*/
private String[] getUncachedFiles() {
if (fileDiffs.length == 0) return fileDiffs;
- List existing = new ArrayList();
+ List<String> existing = new ArrayList<>();
for (int i = 0; i < fileDiffs.length; i++) {
String filePath = fileDiffs[i];
try {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java
index 9087d57ab..57cefe6cc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java
@@ -35,7 +35,7 @@ public class FileModificationManager implements IResourceChangeListener {
private static final QualifiedName UPDATE_TIMESTAMP = new QualifiedName(CVSProviderPlugin.ID, "update-timestamp"); //$NON-NLS-1$
- /* private */Set modifiedResources = new HashSet();
+ /* private */Set<IResource> modifiedResources = new HashSet<>();
// consider the following changes types and ignore the others (e.g. marker and description changes are ignored)
protected int INTERESTING_CHANGES = IResourceDelta.CONTENT |
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
index ec058582c..241de7053 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
@@ -156,7 +156,7 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
};
// Build the local options
- final List localOptions = new ArrayList();
+ final List<LocalOption> localOptions = new ArrayList<>();
localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
if (tag != null && tag.getType() != CVSTag.HEAD)
localOptions.add(Update.makeTagOption(tag));
@@ -227,7 +227,7 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
* @see ICVSFolder#members(int)
*/
public ICVSResource[] members(int flags) throws CVSException {
- final List result = new ArrayList();
+ final List<ICVSResource> result = new ArrayList<>();
ICVSRemoteResource[] resources = getChildren();
if (children == null) {
return new ICVSResource[0];
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java
index c23cc5b25..75e9ede66 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher.java
@@ -34,10 +34,10 @@ public class RemoteFolderMemberFetcher implements IUpdateMessageListener, IStatu
private final RemoteFolder parentFolder;
private CVSTag tag;
- List folders = new ArrayList(); // RemoteFolder
- List files = new ArrayList(); // RemoteFile
+ List<RemoteFolder> folders = new ArrayList<>();
+ List<RemoteFile> files = new ArrayList<>();
boolean exists = true;
- List exceptions = new ArrayList(); // CVSException
+ List<CVSException> exceptions = new ArrayList<>();
protected RemoteFolderMemberFetcher(RemoteFolder parentFolder, CVSTag tag) {
this.tag = tag;
@@ -98,7 +98,7 @@ public class RemoteFolderMemberFetcher implements IUpdateMessageListener, IStatu
session.open(Policy.subMonitorFor(progress, 10), false /* read-only */);
try {
// Build the local options
- final List localOptions = new ArrayList();
+ final List<LocalOption> localOptions = new ArrayList<>();
localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
if (tag != null) localOptions.add(Update.makeTagOption(tag));
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderSandbox.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderSandbox.java
index 046dd6a40..abe7a19b1 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderSandbox.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderSandbox.java
@@ -117,7 +117,7 @@ public class RemoteFolderSandbox extends RemoteFolder {
public void remove(RemoteFile file) {
ICVSRemoteResource[] children = getChildren();
- ArrayList results = new ArrayList();
+ ArrayList<ICVSRemoteResource> results = new ArrayList<>();
for (int i = 0; i < children.length; i++) {
if (children[i] != file){
results.add(children[i]);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
index eee273adc..4c2f3a2ae 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
@@ -44,9 +44,9 @@ public class RemoteFolderTreeBuilder {
private static final int MAX_REVISION_FETCHES_PER_CONNECTION = 1024;
- private Map fileDeltas;
- private List changedFiles;
- private Map remoteFolderTable;
+ private Map<String, Map> fileDeltas;
+ private List<String> changedFiles;
+ private Map<String, RemoteFolderTree> remoteFolderTable;
private ICVSFolder root;
private RemoteFolderTree remoteRoot;
@@ -96,12 +96,12 @@ public class RemoteFolderTreeBuilder {
this.repository = repository;
this.root = root;
this.tag = tag;
- this.fileDeltas = new HashMap();
- this.changedFiles = new ArrayList();
- this.remoteFolderTable = new HashMap();
+ this.fileDeltas = new HashMap<String, Map>();
+ this.changedFiles = new ArrayList<String>();
+ this.remoteFolderTable = new HashMap<String, RemoteFolderTree>();
// Build the local options
- List localOptions = new ArrayList();
+ List<LocalOption> localOptions = new ArrayList<>();
if (tag != null) {
if (tag.getType() == CVSTag.HEAD) {
localOptions.add(Update.CLEAR_STICKY);
@@ -109,14 +109,14 @@ public class RemoteFolderTreeBuilder {
localOptions.add(Update.makeTagOption(tag));
}
}
- updateLocalOptions = (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
+ updateLocalOptions = localOptions.toArray(new LocalOption[localOptions.size()]);
}
private LocalOption[] getOptionsWithoutTag() {
// Build the local options
- List localOptions = new ArrayList();
+ List<LocalOption> localOptions = new ArrayList<>();
localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
- return (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
+ return localOptions.toArray(new LocalOption[localOptions.size()]);
}
public static RemoteFolder buildBaseTree(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag, IProgressMonitor progress) throws CVSException {
@@ -177,7 +177,7 @@ public class RemoteFolderTreeBuilder {
private boolean fetchDelta(ICVSResource[] resources, IProgressMonitor monitor) throws CVSException {
// Get the arguments from the files
- ArrayList arguments = new ArrayList();
+ ArrayList<String> arguments = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
ICVSResource resource = resources[i];
arguments.add(resource.getRelativePath(root));
@@ -190,7 +190,7 @@ public class RemoteFolderTreeBuilder {
session.open(Policy.subMonitorFor(monitor, 10), false /* read-only */);
try {
Policy.checkCanceled(monitor);
- fetchDelta(session, (String[]) arguments.toArray(new String[arguments.size()]), Policy.subMonitorFor(monitor, 90));
+ fetchDelta(session, arguments.toArray(new String[arguments.size()]), Policy.subMonitorFor(monitor, 90));
if (rootDoesNotExist) {
// We cannot handle the case where a project (i.e. the top-most CVS folder)
// has been deleted directly on the sever (i.e. deleted using rm -rf)
@@ -260,7 +260,7 @@ public class RemoteFolderTreeBuilder {
private void fetchFileRevisions(IProgressMonitor monitor) throws CVSException {
// 3rd+ Connection: Used to fetch file status in groups of 1024
if (remoteRoot != null && !changedFiles.isEmpty()) {
- String[] allChangedFiles = (String[])changedFiles.toArray(new String[changedFiles.size()]);
+ String[] allChangedFiles = changedFiles.toArray(new String[changedFiles.size()]);
int iterations = (allChangedFiles.length / MAX_REVISION_FETCHES_PER_CONNECTION)
+ (allChangedFiles.length % MAX_REVISION_FETCHES_PER_CONNECTION == 0 ? 0 : 1);
for (int i = 0; i < iterations ; i++) {
@@ -306,7 +306,7 @@ public class RemoteFolderTreeBuilder {
tagForRemoteFolder(root, tag));
// Create the remote resource (using the delta if there is one)
RemoteFile remoteFile;
- Map deltas = (Map)fileDeltas.get(""); //$NON-NLS-1$
+ Map deltas = fileDeltas.get(""); //$NON-NLS-1$
if (deltas == null || deltas.isEmpty()) {
// If the file is an addition, return null as the remote
// Note: If there was a conflicting addition, the delta would not be empty
@@ -340,7 +340,7 @@ public class RemoteFolderTreeBuilder {
session = new Session(repository, remoteRoot, false);
session.open(Policy.subMonitorFor(monitor, 10), false /* read-only */);
try {
- fetchFileRevisions(session, (String[])changedFiles.toArray(new String[changedFiles.size()]), Policy.subMonitorFor(monitor, 20));
+ fetchFileRevisions(session, changedFiles.toArray(new String[changedFiles.size()]), Policy.subMonitorFor(monitor, 20));
} finally {
session.close();
}
@@ -377,7 +377,7 @@ public class RemoteFolderTreeBuilder {
RemoteFolder remote = createRemoteFolder(local, parent, folderSyncInfo);
// Create a List to contain the created children
- List children = new ArrayList();
+ List<RemoteResource> children = new ArrayList<>();
// Build the child folders corresponding to local folders base
ICVSResource[] folders = local.members(ICVSFolder.FOLDER_MEMBERS);
@@ -415,7 +415,7 @@ public class RemoteFolderTreeBuilder {
return null;
// Add the children to the remote folder tree
- remote.setChildren((ICVSRemoteResource[])children.toArray(new ICVSRemoteResource[children.size()]));
+ remote.setChildren(children.toArray(new ICVSRemoteResource[children.size()]));
return remote;
}
@@ -443,7 +443,7 @@ public class RemoteFolderTreeBuilder {
recordRemoteFolder(remote);
// Create a map to contain the created children
- Map children = new HashMap();
+ Map<String, RemoteResource> children = new HashMap<>();
// If there's no corresponding local resource then we need to fetch its contents in order to populate the deltas
if (local == null) {
@@ -451,7 +451,7 @@ public class RemoteFolderTreeBuilder {
}
// Fetch the delta's for the folder
- Map deltas = (Map)fileDeltas.get(localPath);
+ Map deltas = fileDeltas.get(localPath);
if (deltas == null)
deltas = EMPTY_MAP;
@@ -531,13 +531,13 @@ public class RemoteFolderTreeBuilder {
}
// Add the children to the remote folder tree
- remote.setChildren((ICVSRemoteResource[])children.values().toArray(new ICVSRemoteResource[children.size()]));
+ remote.setChildren(children.values().toArray(new ICVSRemoteResource[children.size()]));
// We have to delay building the child folders to support the proper fetching of new directories
// due to the fact that the same CVS home directory (i.e. the same root directory) must
// be used for all requests sent over the same connection
Iterator childIterator = children.entrySet().iterator();
- List emptyChildren = new ArrayList();
+ List<RemoteFolderTree> emptyChildren = new ArrayList<>();
while (childIterator.hasNext()) {
Map.Entry entry = (Map.Entry)childIterator.next();
if (((RemoteResource)entry.getValue()).isFolder()) {
@@ -568,10 +568,10 @@ public class RemoteFolderTreeBuilder {
// Prune any empty child folders
if (isPruneEmptyDirectories() && !emptyChildren.isEmpty()) {
- List newChildren = new ArrayList();
+ List<ICVSRemoteResource> newChildren = new ArrayList<ICVSRemoteResource>();
newChildren.addAll(Arrays.asList(remote.getChildren()));
newChildren.removeAll(emptyChildren);
- remote.setChildren((ICVSRemoteResource[])newChildren.toArray(new ICVSRemoteResource[newChildren.size()]));
+ remote.setChildren(newChildren.toArray(new ICVSRemoteResource[newChildren.size()]));
}
}
@@ -582,7 +582,7 @@ public class RemoteFolderTreeBuilder {
*
* Returns the list of changed files
*/
- private List fetchDelta(Session session, String[] arguments, final IProgressMonitor monitor) throws CVSException {
+ private List<String> fetchDelta(Session session, String[] arguments, final IProgressMonitor monitor) throws CVSException {
// Create an listener that will accumulate new and removed files and folders
IUpdateMessageListener listener = new IUpdateMessageListener() {
@@ -614,7 +614,7 @@ public class RemoteFolderTreeBuilder {
// The change could be a local change conflicting with a remote deletion.
// If so, the deltas may already have a DELETED for the file.
// We shouldn't override this DELETED
- Map deltas = (Map)fileDeltas.get(Util.removeLastSegment(filename));
+ Map deltas = fileDeltas.get(Util.removeLastSegment(filename));
DeltaNode d = deltas != null ? (DeltaNode)deltas.get(Util.getLastSegment(filename)) : null;
if ((d!=null) && (d.getRevision() == DELETED))
break;
@@ -714,7 +714,7 @@ public class RemoteFolderTreeBuilder {
private void fetchFileRevisions(Session session, String[] fileNames, final IProgressMonitor monitor) throws CVSException {
// Create a listener for receiving the revision info
- final List exceptions = new ArrayList();
+ final List<CVSException> exceptions = new ArrayList<CVSException>();
IStatusListener listener = new IStatusListener() {
public void fileStatus(ICVSFolder root, String path, String remoteRevision) {
try {
@@ -740,11 +740,11 @@ public class RemoteFolderTreeBuilder {
// Report any exceptions that occurred fetching the revisions
if ( ! exceptions.isEmpty()) {
if (exceptions.size() == 1) {
- throw (CVSException)exceptions.get(0);
+ throw exceptions.get(0);
} else {
MultiStatus multi = new MultiStatus(CVSProviderPlugin.ID, 0, CVSMessages.RemoteFolder_errorFetchingRevisions, null);
for (int i = 0; i < exceptions.size(); i++) {
- multi.merge(((CVSException)exceptions.get(i)).getStatus());
+ multi.merge(exceptions.get(i).getStatus());
}
throw new CVSException(multi);
}
@@ -767,9 +767,9 @@ public class RemoteFolderTreeBuilder {
newFolderExist = true;
}
String parent = Util.removeLastSegment(path);
- Map deltas = (Map)fileDeltas.get(parent);
+ Map<String, DeltaNode> deltas = fileDeltas.get(parent);
if (deltas == null) {
- deltas = new HashMap();
+ deltas = new HashMap<>();
fileDeltas.put(parent, deltas);
}
String name = Util.getLastSegment(path);
@@ -810,7 +810,7 @@ public class RemoteFolderTreeBuilder {
}
private RemoteFolderTree getRecoredRemoteFolder(String path) {
- return (RemoteFolderTree)remoteFolderTable.get(Util.asPath(path));
+ return remoteFolderTable.get(Util.asPath(path));
}
/**
@@ -819,6 +819,6 @@ public class RemoteFolderTreeBuilder {
* @return an array of differing files
*/
public String[] getFileDiffs() {
- return (String[]) changedFiles.toArray(new String[changedFiles.size()]);
+ return changedFiles.toArray(new String[changedFiles.size()]);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
index 296213829..629cbd9a8 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
@@ -75,11 +75,11 @@ public class RemoteModule extends RemoteFolder {
// Read the module name
StringTokenizer tokenizer = new StringTokenizer(moduleDefinitionStrings[i]);
String moduleName = tokenizer.nextToken();
- List localOptionsList;
+ List<LocalOption> localOptionsList;
String next;
try {
// Read the options associated with the module
- localOptionsList = new ArrayList();
+ localOptionsList = new ArrayList<>();
next = tokenizer.nextToken();
while (next.charAt(0) == '-') {
switch (next.charAt(1)) {
@@ -154,7 +154,7 @@ public class RemoteModule extends RemoteFolder {
// Record any referenced modules so that can be cross-referenced below
if (next.charAt(0) == '&') {
- List children = new ArrayList(10);
+ List<String> children = new ArrayList<>(10);
children.add(next);
while (tokenizer.hasMoreTokens())
children.add(tokenizer.nextToken());
@@ -212,7 +212,7 @@ public class RemoteModule extends RemoteFolder {
String[] children = (String[])referencedModulesTable.get(moduleName);
if (children != null) {
RemoteModule module = (RemoteModule)modules.get(moduleName);
- List referencedFolders = new ArrayList();
+ List<RemoteModule> referencedFolders = new ArrayList<>();
boolean expandable = true;
for (int i = 0; i < children.length; i++) {
RemoteModule child = (RemoteModule)modules.get(children[i].substring(1));
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
index de12a76e2..36246155e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
@@ -145,7 +145,7 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
/*package*/ IResource[] purgeCache(IContainer container, boolean deep) throws CVSException {
if (! container.exists()) return new IResource[0];
try {
- Set flushed = new HashSet();
+ Set<IResource> flushed = new HashSet<>();
if (container.getType() != IResource.ROOT) {
safeSetSessionProperty(container, IGNORE_SYNC_KEY, null);
safeSetSessionProperty(container, FOLDER_SYNC_KEY, null);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java
index 624943916..a9f0268a6 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java
@@ -39,7 +39,7 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
/*package*/ class SynchronizerSyncInfoCache extends SyncInfoCache {
// Map of sync bytes that were set without a scheduling rule
- Map pendingCacheWrites = new HashMap();
+ Map<IResource, Object> pendingCacheWrites = new HashMap<>();
private static final Object BYTES_REMOVED = new byte[0];
public SynchronizerSyncInfoCache() {
@@ -324,7 +324,7 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
public IResource[] members(IContainer folder) throws CoreException {
IResource[] pendingWrites = getPendingCacheWrites();
if (pendingWrites != null){
- HashSet cachedResources = new HashSet();
+ HashSet<IResource> cachedResources = new HashSet<>();
for (int i = 0; i < pendingWrites.length; i++) {
IResource resource = pendingWrites[i];
if (resource.getParent().equals(folder))
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/UpdateContentCachingService.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/UpdateContentCachingService.java
index be7102fb1..854884c05 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/UpdateContentCachingService.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/UpdateContentCachingService.java
@@ -41,7 +41,7 @@ public class UpdateContentCachingService implements IUpdateMessageListener {
private final CVSTag tag;
private final int depth;
private boolean fetchAbsentDirectories = true;
- private ArrayList removed = new ArrayList();
+ private ArrayList<ICVSResource> removed = new ArrayList<>();
public class SandboxUpdate extends Update {
@@ -263,7 +263,7 @@ public class UpdateContentCachingService implements IUpdateMessageListener {
}
private LocalOption[] getLocalOptions() {
- ArrayList options = new ArrayList();
+ ArrayList<LocalOption> options = new ArrayList<>();
if (tag != null)
options.add(Update.makeTagOption(tag));
diff --git a/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
index 458bd854d..d86a618c3 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.ssh2; singleton:=true
-Bundle-Version: 3.3.200.qualifier
+Bundle-Version: 3.3.300.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.ssh2.CVSSSH2Plugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.team.cvs.ssh2/pom.xml b/bundles/org.eclipse.team.cvs.ssh2/pom.xml
index 1a36108e7..0a5f30af8 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/pom.xml
+++ b/bundles/org.eclipse.team.cvs.ssh2/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.ssh2</artifactId>
- <version>3.3.200-SNAPSHOT</version>
+ <version>3.3.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java
index 6482fcf9d..a31de7776 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/CVSSSH2Plugin.java
@@ -58,7 +58,7 @@ public class CVSSSH2Plugin extends Plugin {
super.start(context);
// register debug options listener
- Hashtable properties = new Hashtable(2);
+ Hashtable<String, String> properties = new Hashtable<>(2);
properties.put(DebugOptions.LISTENER_SYMBOLICNAME, ID);
debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER, properties);
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java
index ca5aad664..3e290148c 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java
@@ -15,6 +15,7 @@
package org.eclipse.team.internal.ccvs.ssh2;
import java.util.Enumeration;
+import java.util.Hashtable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -28,7 +29,7 @@ import com.jcraft.jsch.*;
class JSchSession {
private static final int SSH_DEFAULT_PORT = 22;
- private static java.util.Hashtable pool = new java.util.Hashtable();
+ private static Hashtable<String, JSchSession> pool = new Hashtable<>();
private final Session session;
private final ICVSRepositoryLocation location;
@@ -52,7 +53,7 @@ class JSchSession {
String key = getPoolKey(username, hostname, actualPort);
try {
- JSchSession jschSession = (JSchSession) pool.get(key);
+ JSchSession jschSession = pool.get(key);
if (jschSession != null && !jschSession.getSession().isConnected()) {
pool.remove(key);
jschSession = null;
diff --git a/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
index dde714011..162ad9448 100644
--- a/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.ui; singleton:=true
-Bundle-Version: 3.4.300.qualifier
+Bundle-Version: 3.4.400.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.ui.CVSUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.team.cvs.ui/pom.xml b/bundles/org.eclipse.team.cvs.ui/pom.xml
index d7785d179..7e81489b2 100644
--- a/bundles/org.eclipse.team.cvs.ui/pom.xml
+++ b/bundles/org.eclipse.team.cvs.ui/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.ui</artifactId>
- <version>3.4.300-SNAPSHOT</version>
+ <version>3.4.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java
index b085cfec3..64792bfb4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java
@@ -32,6 +32,7 @@ public class BranchAction extends WorkspaceTraversalAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#execute(org.eclipse.jface.action.IAction)
*/
+ @Override
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
ResourceMapping[] resourceMappings = getCVSResourceMappings();
if (resourceMappings == null || resourceMappings.length == 0) {
@@ -47,7 +48,7 @@ public class BranchAction extends WorkspaceTraversalAction {
}
private ResourceMapping[] getResourceMappings(IResource[] resources) {
- List mappings = new ArrayList();
+ List<ResourceMapping> mappings = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
Object o = getAdapter(resource, ResourceMapping.class);
@@ -56,12 +57,13 @@ public class BranchAction extends WorkspaceTraversalAction {
mappings.add(mapping);
}
}
- return (ResourceMapping[]) mappings.toArray(new ResourceMapping[mappings.size()]);
+ return mappings.toArray(new ResourceMapping[mappings.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
*/
+ @Override
public String getId() {
return ICVSUIConstants.CMD_BRANCH;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
index 7b0ec93b5..054672f1d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
@@ -54,7 +54,7 @@ import org.eclipse.ui.ide.IDE;
*/
abstract public class CVSAction extends TeamAction implements IEditorActionDelegate {
- private List accumulatedStatus = new ArrayList();
+ private List<IStatus> accumulatedStatus = new ArrayList<>();
private RetargetAction retargetAction;
private IAction action;
@@ -255,7 +255,7 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
* will include any OK status that were added using addStatus(IStatus)
*/
protected IStatus[] getAccumulatedStatus() {
- return (IStatus[]) accumulatedStatus.toArray(new IStatus[accumulatedStatus.size()]);
+ return accumulatedStatus.toArray(new IStatus[accumulatedStatus.size()]);
}
/**
@@ -314,7 +314,7 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
@Override
protected void handle(Exception exception) {
// Get the non-OK status
- List problems = new ArrayList();
+ List<IStatus> problems = new ArrayList<>();
IStatus[] status = getAccumulatedStatus();
if (status != null) {
for (int i = 0; i < status.length; i++) {
@@ -338,7 +338,7 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
}
String message = null;
- IStatus statusToDisplay = getStatusToDisplay((IStatus[]) problems.toArray(new IStatus[problems.size()]));
+ IStatus statusToDisplay = getStatusToDisplay(problems.toArray(new IStatus[problems.size()]));
if (statusToDisplay.isOK()) return;
if (statusToDisplay.isMultiStatus() && statusToDisplay.getChildren().length == 1) {
message = statusToDisplay.getMessage();
@@ -406,10 +406,10 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
* Returns the selected CVS resources
*/
protected ICVSResource[] getSelectedCVSResources() {
- ArrayList resources = null;
+ ArrayList<Object> resources = null;
IStructuredSelection selection = getSelection();
if (!selection.isEmpty()) {
- resources = new ArrayList();
+ resources = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = elements.next();
@@ -428,7 +428,7 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
}
}
if (resources != null && !resources.isEmpty()) {
- return (ICVSResource[])resources.toArray(new ICVSResource[resources.size()]);
+ return resources.toArray(new ICVSResource[resources.size()]);
}
return new ICVSResource[0];
}
@@ -437,10 +437,10 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
* Get selected CVS remote folders
*/
protected ICVSRemoteFolder[] getSelectedRemoteFolders() {
- ArrayList resources = null;
+ ArrayList<Object> resources = null;
IStructuredSelection selection = getSelection();
if (!selection.isEmpty()) {
- resources = new ArrayList();
+ resources = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = elements.next();
@@ -459,7 +459,7 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
}
}
if (resources != null && !resources.isEmpty()) {
- return (ICVSRemoteFolder[])resources.toArray(new ICVSRemoteFolder[resources.size()]);
+ return resources.toArray(new ICVSRemoteFolder[resources.size()]);
}
return new ICVSRemoteFolder[0];
}
@@ -468,10 +468,10 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
* Returns the selected remote resources
*/
protected ICVSRemoteResource[] getSelectedRemoteResources() {
- ArrayList resources = null;
+ ArrayList<Object> resources = null;
IStructuredSelection selection = getSelection();
if (!selection.isEmpty()) {
- resources = new ArrayList();
+ resources = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = elements.next();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java
index 368f24a48..efb33606d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java
@@ -28,10 +28,10 @@ import org.eclipse.team.internal.ui.Utils;
public class CVSActionSelectionProperties {
// Use a weak hash map so that the properties ae collected when the selection is no longer referenced
- private static Map selectionProperties = new WeakHashMap();
+ private static Map<IStructuredSelection, CVSActionSelectionProperties> selectionProperties = new WeakHashMap<>();
private Object[] selection;
- private Map properties = new HashMap();
+ private Map<String, Object> properties = new HashMap<>();
private static final String SELECTED_RESOURCES = "selectedResources"; //$NON-NLS-1$
private static final String NONOVERLAPPING_SELECTED_RESOURCES = "nonoverlappingSelectedResources"; //$NON-NLS-1$
@@ -39,7 +39,7 @@ public class CVSActionSelectionProperties {
public static CVSActionSelectionProperties getProperties(IStructuredSelection selection) {
if (selection == null) return null;
- CVSActionSelectionProperties props = (CVSActionSelectionProperties)selectionProperties.get(selection);
+ CVSActionSelectionProperties props = selectionProperties.get(selection);
if (props == null) {
props = new CVSActionSelectionProperties(selection);
selectionProperties.put(selection, props);
@@ -125,7 +125,7 @@ public class CVSActionSelectionProperties {
}
});
// Collect all non-overlapping resources
- List coveredPaths = new ArrayList();
+ List<IPath> coveredPaths = new ArrayList<>();
for (Iterator iter = sorted.iterator(); iter.hasNext();) {
IResource resource = (IResource) iter.next();
IPath resourceFullPath = resource.getFullPath();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java
index 50ada4aad..bbe2c9ba2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ConfigureTagsFromRepoViewOnFolder.java
@@ -39,10 +39,10 @@ public class ConfigureTagsFromRepoViewOnFolder extends CVSAction {
*/
@Override
protected ICVSRemoteFolder[] getSelectedRemoteFolders() {
- ArrayList resources = null;
+ ArrayList<Object> resources = null;
IStructuredSelection selection = getSelection();
if (!selection.isEmpty()) {
- resources = new ArrayList();
+ resources = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = elements.next();
@@ -55,7 +55,7 @@ public class ConfigureTagsFromRepoViewOnFolder extends CVSAction {
}
}
if (resources != null && !resources.isEmpty()) {
- return (ICVSRemoteFolder[])resources.toArray(new ICVSRemoteFolder[resources.size()]);
+ return resources.toArray(new ICVSRemoteFolder[resources.size()]);
}
return new ICVSRemoteFolder[0];
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java
index e2072517e..173e9eb0e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java
@@ -62,7 +62,7 @@ public class GenerateDiffFileAction extends WorkspaceTraversalAction{
private IResource[] getDeepResourcesToPatch(IProgressMonitor monitor) throws CoreException {
ResourceMapping[] mappings = getCVSResourceMappings();
- List roots = new ArrayList();
+ List<IResource> roots = new ArrayList<>();
for (int i = 0; i < mappings.length; i++) {
ResourceMapping mapping = mappings[i];
ResourceTraversal[] traversals = mapping.getTraversals(
@@ -86,10 +86,10 @@ public class GenerateDiffFileAction extends WorkspaceTraversalAction{
}
}
}
- return (IResource[]) roots.toArray(new IResource[roots.size()]);
+ return roots.toArray(new IResource[roots.size()]);
}
- private void collectShallowFiles(IResource[] resources, List roots) {
+ private void collectShallowFiles(IResource[] resources, List<IResource> roots) {
for (int k = 0; k < resources.length; k++) {
IResource resource = resources[k];
if (resource.getType() == IResource.FILE)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenLogEntryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenLogEntryAction.java
index 0205a977b..c46467df6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenLogEntryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenLogEntryAction.java
@@ -32,10 +32,10 @@ public class OpenLogEntryAction extends CVSAction {
* Returns the selected remote files
*/
protected ILogEntry[] getSelectedLogEntries() {
- ArrayList entries = null;
+ ArrayList<Object> entries = null;
IStructuredSelection selection = getSelection();
if (!selection.isEmpty()) {
- entries = new ArrayList();
+ entries = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = elements.next();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenRemoteFileAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenRemoteFileAction.java
index 248ede37a..1b42777fd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenRemoteFileAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/OpenRemoteFileAction.java
@@ -30,10 +30,10 @@ public class OpenRemoteFileAction extends CVSAction {
* Returns the selected remote files
*/
protected ICVSRemoteFile[] getSelectedRemoteFiles() {
- ArrayList resources = null;
+ ArrayList<Object> resources = null;
IStructuredSelection selection = getSelection();
if (!selection.isEmpty()) {
- resources = new ArrayList();
+ resources = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = elements.next();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java
index 2b938715b..994ca7e6a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java
@@ -59,7 +59,7 @@ public class RestoreFromRepositoryAction extends WorkspaceTraversalAction {
private static final String RCS_FILE_POSTFIX = ",v"; //$NON-NLS-1$
private static final String LOGGING_PREFIX = "Logging "; //$NON-NLS-1$
ICVSFolder currentFolder;
- List atticFiles = new ArrayList();
+ List<ICVSFile> atticFiles = new ArrayList<>();
@Override
public IStatus messageLine(
@@ -142,7 +142,7 @@ public class RestoreFromRepositoryAction extends WorkspaceTraversalAction {
}
public ICVSFile[] getAtticFilePaths() {
- return (ICVSFile[]) atticFiles.toArray(new ICVSFile[atticFiles.size()]);
+ return atticFiles.toArray(new ICVSFile[atticFiles.size()]);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java
index b4f885037..3e68bd2f0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java
@@ -30,10 +30,10 @@ public class ShowHistoryAction extends CVSAction {
* Returns the selected remote files
*/
protected ICVSRemoteFile[] getSelectedRemoteFiles() {
- ArrayList resources = null;
+ ArrayList<Object> resources = null;
IStructuredSelection selection = getSelection();
if (!selection.isEmpty()) {
- resources = new ArrayList();
+ resources = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = elements.next();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index b44e6082e..8a78ab47b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -99,7 +99,7 @@ public class SyncAction extends WorkspaceTraversalAction {
private IWorkingSet[] getSelectedWorkingSets() {
ResourceMapping[] mappings = getCVSResourceMappings();
- List sets = new ArrayList();
+ List<IWorkingSet> sets = new ArrayList<>();
for (int i = 0; i < mappings.length; i++) {
ResourceMapping mapping = mappings[i];
if (mapping.getModelObject() instanceof IWorkingSet) {
@@ -111,7 +111,7 @@ public class SyncAction extends WorkspaceTraversalAction {
}
if (sets.isEmpty())
return null;
- return (IWorkingSet[]) sets.toArray(new IWorkingSet[sets.size()]);
+ return sets.toArray(new IWorkingSet[sets.size()]);
}
private boolean includesAllCVSProjects(IResource[] resources) {
@@ -127,14 +127,14 @@ public class SyncAction extends WorkspaceTraversalAction {
private IProject[] getAllCVSProjects() {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- Set cvsProjects = new HashSet();
+ Set<IProject> cvsProjects = new HashSet<>();
for (int i = 0; i < projects.length; i++) {
IProject project = projects[i];
if (RepositoryProvider.isShared(project) && RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId()) != null) {
cvsProjects.add(project);
}
}
- return (IProject[]) cvsProjects.toArray(new IProject[cvsProjects.size()]);
+ return cvsProjects.toArray(new IProject[cvsProjects.size()]);
}
/**
@@ -264,7 +264,7 @@ public class SyncAction extends WorkspaceTraversalAction {
}
private Set getProjects(IWorkingSet[] sets) {
- Set projects = new HashSet();
+ Set<IProject> projects = new HashSet<>();
if(sets == null)
return projects;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
index 7ad0355dd..0e30db985 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
@@ -171,13 +171,13 @@ public abstract class WorkspaceAction extends CVSAction {
} catch (CVSException e) {
if (e.getStatus().getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL) {
// determine the projects of the resources involved
- Set projects = new HashSet();
+ Set<IProject> projects = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
projects.add(resource.getProject());
}
// prompt to refresh
- if (promptToRefresh(getShell(), (IResource[]) projects.toArray(new IResource[projects.size()]), e.getStatus())) {
+ if (promptToRefresh(getShell(), projects.toArray(new IResource[projects.size()]), e.getStatus())) {
for (Iterator iter = projects.iterator();iter.hasNext();) {
IProject project = (IProject) iter.next();
try {
@@ -303,8 +303,8 @@ public abstract class WorkspaceAction extends CVSAction {
if (!isEnabledForMultipleResources() && resources.length != 1) return false;
// validate enabled for each resource in the selection
- List folderPaths = new ArrayList();
- List filePaths = new ArrayList();
+ List<IPath> folderPaths = new ArrayList<>();
+ List<IPath> filePaths = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
@@ -439,8 +439,8 @@ public abstract class WorkspaceAction extends CVSAction {
while (iterator.hasNext()) {
IProgressMonitor subMonitor = SubMonitor.convert(monitor, 1000);
CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
+ List<?> list = (List) table.get(provider);
+ IResource[] providerResources = list.toArray(new IResource[list.size()]);
try {
addStatus(action.execute(provider, providerResources, subMonitor));
} catch (CVSException e) {
@@ -531,7 +531,7 @@ public abstract class WorkspaceAction extends CVSAction {
}
protected IResource[] checkOverwriteOfDirtyResources(IResource[] resources, IProgressMonitor monitor) throws CVSException, InterruptedException {
- List dirtyResources = new ArrayList();
+ List<IResource> dirtyResources = new ArrayList<>();
IResource[] selectedResources = getSelectedResources();
try {
@@ -550,7 +550,7 @@ public abstract class WorkspaceAction extends CVSAction {
}
PromptingDialog dialog = new PromptingDialog(getShell(), selectedResources,
- getPromptCondition((IResource[]) dirtyResources.toArray(new IResource[dirtyResources.size()])), CVSUIMessages.ReplaceWithAction_confirmOverwrite);
+ getPromptCondition(dirtyResources.toArray(new IResource[dirtyResources.size()])), CVSUIMessages.ReplaceWithAction_confirmOverwrite);
return dialog.promptForMultiple();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceTraversalAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceTraversalAction.java
index b02879137..9bdb8d460 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceTraversalAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceTraversalAction.java
@@ -17,8 +17,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.HashSet;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.*;
import org.eclipse.core.resources.mapping.*;
import org.eclipse.core.runtime.*;
import org.eclipse.team.core.RepositoryProvider;
@@ -65,7 +64,7 @@ public abstract class WorkspaceTraversalAction extends WorkspaceAction {
}
private static IResource[] getRootTraversalResources(ISynchronizationScopeManager manager, IProgressMonitor monitor) throws CoreException {
- Set result = new HashSet();
+ Set<IResource> result = new HashSet<>();
ResourceTraversal[] traversals = getTraversals(null, manager, monitor);
for (int i = 0; i < traversals.length; i++) {
ResourceTraversal traversal = traversals[i];
@@ -77,7 +76,7 @@ public abstract class WorkspaceTraversalAction extends WorkspaceAction {
}
}
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
protected Subscriber getWorkspaceSubscriber() {
@@ -122,12 +121,12 @@ public abstract class WorkspaceTraversalAction extends WorkspaceAction {
}
public static IResource[] getProjects(IResource[] resources) {
- Set projects = new HashSet();
+ Set<IProject> projects = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
projects.add(resource.getProject());
}
- return (IResource[]) projects.toArray(new IResource[projects.size()]);
+ return projects.toArray(new IResource[projects.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/AbstractCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/AbstractCommitAction.java
index 52e83242e..b00a37b4c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/AbstractCommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/AbstractCommitAction.java
@@ -80,7 +80,7 @@ public abstract class AbstractCommitAction extends CVSModelProviderAction {
protected abstract ResourceTraversal[] getCommitTraversals(IStructuredSelection selection, IProgressMonitor monitor) throws CoreException;
public static IResource[] getOutgoingChanges(final IResourceDiffTree tree, ResourceTraversal[] traversals, IProgressMonitor monitor) {
- final List resources = new ArrayList();
+ final List<IResource> resources = new ArrayList<>();
IDiff[] diffs = tree.getDiffs(traversals);
for (int i = 0; i < diffs.length; i++) {
IDiff diff = diffs[i];
@@ -90,7 +90,7 @@ public abstract class AbstractCommitAction extends CVSModelProviderAction {
resources.add(resource);
}
}
- return (IResource[]) resources.toArray(new IResource[resources.size()]);
+ return resources.toArray(new IResource[resources.size()]);
}
public static boolean hasLocalChange(IDiff diff) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelProviderAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelProviderAction.java
index 1f7c88a77..497c50608 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelProviderAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSModelProviderAction.java
@@ -43,14 +43,14 @@ public abstract class CVSModelProviderAction extends ResourceModelParticipantAct
}
protected ResourceMapping[] getResourceMappings(IStructuredSelection selection) {
- List mappings = new ArrayList();
+ List<ResourceMapping> mappings = new ArrayList<>();
for (Iterator iter = selection.iterator(); iter.hasNext();) {
Object element = iter.next();
ResourceMapping mapping = Utils.getResourceMapping(element);
if (mapping != null)
mappings.add(mapping);
}
- return (ResourceMapping[]) mappings.toArray(new ResourceMapping[mappings.size()]);
+ return mappings.toArray(new ResourceMapping[mappings.size()]);
}
/**
@@ -71,7 +71,7 @@ public abstract class CVSModelProviderAction extends ResourceModelParticipantAct
protected IResource[] getTargetResources() {
IStructuredSelection selection = getStructuredSelection();
Object[] objects = selection.toArray();
- Set roots = new HashSet();
+ Set<IResource> roots = new HashSet<>();
for (int i = 0; i < objects.length; i++) {
Object object = objects[i];
ResourceMapping mapping = Utils.getResourceMapping(object);
@@ -91,7 +91,7 @@ public abstract class CVSModelProviderAction extends ResourceModelParticipantAct
}
}
}
- return (IResource[]) roots.toArray(new IResource[roots.size()]);
+ return roots.toArray(new IResource[roots.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSSubscriberMergeContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSSubscriberMergeContext.java
index 9548be63c..ed5c5d594 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSSubscriberMergeContext.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSSubscriberMergeContext.java
@@ -130,12 +130,12 @@ public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
private IStatus internalMerge(final IDiff[] diffs, final boolean ignoreLocalChanges, IProgressMonitor monitor) throws CoreException {
// The list of diffs that add or change the local file
- List fileChanges = new ArrayList();
+ List<IDiff> fileChanges = new ArrayList<>();
// The list of folders diffs
List<IDiff> folderDiffs = new ArrayList<>();
// The list of diffs that will result in the deletion of
// the local file
- List fileDeletions = new ArrayList();
+ List<IDiff> fileDeletions = new ArrayList<>();
for (int i = 0; i < diffs.length; i++) {
IDiff diff = diffs[i];
@@ -158,10 +158,10 @@ public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
int ticks = (fileDeletions.size() + fileChanges.size()) * 100;
try {
monitor.beginTask(null, ticks);
- List result = new ArrayList();
+ List<IStatus> result = new ArrayList<>();
if (!fileDeletions.isEmpty()) {
IStatus status = CVSSubscriberMergeContext.super.merge(
- (IDiff[]) fileDeletions.toArray(new IDiff[fileDeletions.size()]),
+ fileDeletions.toArray(new IDiff[fileDeletions.size()]),
ignoreLocalChanges,
Policy.subMonitorFor(monitor, 100 * fileDeletions.size()));
if (!status.isOK()) {
@@ -174,7 +174,7 @@ public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
}
if (!fileChanges.isEmpty()) {
IStatus status = CVSSubscriberMergeContext.super.merge(
- (IDiff[]) fileChanges.toArray(new IDiff[fileChanges.size()]),
+ fileChanges.toArray(new IDiff[fileChanges.size()]),
ignoreLocalChanges,
Policy.subMonitorFor(monitor, 100 * fileChanges.size()));
if (!status.isOK()) {
@@ -198,8 +198,8 @@ public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
if (result.isEmpty())
return Status.OK_STATUS;
if (result.size() == 1)
- return (IStatus)result.get(0);
- return new MergeStatus(CVSUIPlugin.ID, ((IStatus)result.get(0)).getMessage(), getFailedFiles(result));
+ return result.get(0);
+ return new MergeStatus(CVSUIPlugin.ID, result.get(0).getMessage(), getFailedFiles(result));
} finally {
monitor.done();
}
@@ -226,7 +226,7 @@ public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
}
private IFile[] getFailedFiles(List result) {
- List failures = new ArrayList();
+ List<IFile> failures = new ArrayList<>();
for (Iterator iter = result.iterator(); iter.hasNext();) {
IStatus status = (IStatus) iter.next();
if (status instanceof MergeStatus) {
@@ -234,7 +234,7 @@ public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
failures.addAll(Arrays.asList(ms.getConflictingFiles()));
}
}
- return (IFile[]) failures.toArray(new IFile[failures.size()]);
+ return failures.toArray(new IFile[failures.size()]);
}
@Override
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java
index 1d6212196..95552b832 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java
@@ -338,7 +338,7 @@ public class ChangeSetActionProvider extends ResourceModelActionProvider {
}
private IResource[] getResources(IDiff[] diffArray) {
- List result = new ArrayList();
+ List<IResource> result = new ArrayList<>();
for (int i = 0; i < diffArray.length; i++) {
IDiff diff = diffArray[i];
IResource resource = ResourceDiffTree.getResourceFor(diff);
@@ -346,7 +346,7 @@ public class ChangeSetActionProvider extends ResourceModelActionProvider {
result.add(resource);
}
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
@Override
@@ -460,7 +460,7 @@ public class ChangeSetActionProvider extends ResourceModelActionProvider {
if (selection instanceof ITreeSelection) {
ITreeSelection ts = (ITreeSelection) selection;
TreePath[] paths = ts.getPaths();
- List result = new ArrayList();
+ List<IDiff> result = new ArrayList<>();
for (int i = 0; i < paths.length; i++) {
TreePath path = paths[i];
IDiff[] diffs = getLocalChanges(path);
@@ -469,7 +469,7 @@ public class ChangeSetActionProvider extends ResourceModelActionProvider {
result.add(diff);
}
}
- return (IDiff[]) result.toArray(new IDiff[result.size()]);
+ return result.toArray(new IDiff[result.size()]);
}
return new IDiff[0];
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java
index b15deaeb5..0a67c2e0e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java
@@ -84,7 +84,7 @@ public class CheckedInChangeSetCollector extends BatchingChangeSetManager implem
}
}
private IPath[] getAffectedPaths(IDiffChangeEvent event) {
- Set result = new HashSet();
+ Set<IPath> result = new HashSet<>();
IPath[] removed = event.getRemovals();
for (int i = 0; i < removed.length; i++) {
IPath path = removed[i];
@@ -100,7 +100,7 @@ public class CheckedInChangeSetCollector extends BatchingChangeSetManager implem
IDiff diff = diffs[j];
result.add(diff.getPath());
}
- return (IPath[]) result.toArray(new IPath[result.size()]);
+ return result.toArray(new IPath[result.size()]);
}
};
@@ -109,7 +109,7 @@ public class CheckedInChangeSetCollector extends BatchingChangeSetManager implem
private LogEntryCache logEntryCache;
private final Subscriber subscriber;
- private HashSet updatedSets;
+ private HashSet<ChangeSet> updatedSets;
public CheckedInChangeSetCollector(ISynchronizePageConfiguration configuration, Subscriber subscriber) {
this.configuration = configuration;
@@ -154,8 +154,8 @@ public class CheckedInChangeSetCollector extends BatchingChangeSetManager implem
}
public void handleChange(IDiffChangeEvent event) {
- List removals = new ArrayList();
- List additions = new ArrayList();
+ List<IPath> removals = new ArrayList<>();
+ List<IDiff> additions = new ArrayList<>();
removals.addAll(Arrays.asList(event.getRemovals()));
additions.addAll(Arrays.asList(event.getAdditions()));
IDiff[] changed = event.getChanges();
@@ -165,10 +165,10 @@ public class CheckedInChangeSetCollector extends BatchingChangeSetManager implem
removals.add(diff.getPath());
}
if (!removals.isEmpty()) {
- remove((IPath[]) removals.toArray(new IPath[removals.size()]));
+ remove(removals.toArray(new IPath[removals.size()]));
}
if (!additions.isEmpty()) {
- add((IDiff[]) additions.toArray(new IDiff[additions.size()]));
+ add(additions.toArray(new IDiff[additions.size()]));
}
}
@@ -262,7 +262,7 @@ public class CheckedInChangeSetCollector extends BatchingChangeSetManager implem
}
private void beginSetUpdate() {
- updatedSets = new HashSet();
+ updatedSets = new HashSet<>();
}
private void endSetUpdate(IProgressMonitor monitor) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/MergeSubscriberContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/MergeSubscriberContext.java
index d7b903203..6b8344a13 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/MergeSubscriberContext.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/MergeSubscriberContext.java
@@ -59,12 +59,12 @@ public class MergeSubscriberContext extends CVSSubscriberMergeContext {
@Override
public void markAsMerged(final IDiff[] diffs, boolean inSyncHint, IProgressMonitor monitor) throws CoreException {
run(monitor1 -> {
- List result = new ArrayList();
+ List<IResource> result = new ArrayList<>();
for (int i = 0; i < diffs.length; i++) {
IDiff diff = diffs[i];
result.add(getDiffTree().getResource(diff));
}
- ((CVSMergeSubscriber) getSubscriber()).merged((IResource[]) result.toArray(new IResource[result.size()]));
+ ((CVSMergeSubscriber) getSubscriber()).merged(result.toArray(new IResource[result.size()]));
}, getMergeRule(diffs), IResource.NONE, monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelMergeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelMergeParticipant.java
index 681e76596..bee1ced8c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelMergeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelMergeParticipant.java
@@ -151,7 +151,7 @@ public class ModelMergeParticipant extends CVSModelSynchronizeParticipant {
throw new CVSException(NLS.bind(CVSUIMessages.MergeSynchronizeParticipant_10, new String[] { id.toString() }));
}
- List resources = new ArrayList();
+ List<IResource> resources = new ArrayList<>();
for (int i = 0; i < rootNodes.length; i++) {
IMemento rootNode = rootNodes[i];
IPath path = new Path(rootNode.getString(CTX_ROOT_PATH));
@@ -166,7 +166,7 @@ public class ModelMergeParticipant extends CVSModelSynchronizeParticipant {
if(resources.isEmpty()) {
throw new CVSException(NLS.bind(CVSUIMessages.MergeSynchronizeParticipant_12, new String[] { id.toString() }));
}
- IResource[] roots = (IResource[]) resources.toArray(new IResource[resources.size()]);
+ IResource[] roots = resources.toArray(new IResource[resources.size()]);
return new CVSMergeSubscriber(id, roots, start, end);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelUpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelUpdateOperation.java
index de62a6923..9c7006a77 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelUpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ModelUpdateOperation.java
@@ -19,7 +19,8 @@ import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.mapping.ResourceMapping;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.core.mapping.provider.SynchronizationContext;
import org.eclipse.team.core.subscribers.SubscriberScopeManager;
@@ -49,6 +50,7 @@ public class ModelUpdateOperation extends AbstractModelMergeOperation {
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#getJobName()
*/
+ @Override
protected String getJobName() {
return CVSUIMessages.UpdateOperation_taskName;
}
@@ -56,6 +58,7 @@ public class ModelUpdateOperation extends AbstractModelMergeOperation {
/* (non-Javadoc)
* @see org.eclipse.team.ui.operations.ResourceMappingOperation#isPreviewRequested()
*/
+ @Override
public boolean isPreviewRequested() {
return super.isPreviewRequested() || !isAttemptHeadlessMerge();
}
@@ -75,6 +78,7 @@ public class ModelUpdateOperation extends AbstractModelMergeOperation {
/* (non-Javadoc)
* @see org.eclipse.team.ui.operations.ResourceMappingMergeOperation#createParticipant()
*/
+ @Override
protected ModelSynchronizeParticipant createParticipant() {
return new WorkspaceModelParticipant(createMergeContext());
}
@@ -82,10 +86,12 @@ public class ModelUpdateOperation extends AbstractModelMergeOperation {
/* (non-Javadoc)
* @see org.eclipse.team.ui.operations.ModelParticipantMergeOperation#createMergeContext()
*/
+ @Override
protected SynchronizationContext createMergeContext() {
return WorkspaceSubscriberContext.createContext(getScopeManager(), getMergeType());
}
+ @Override
protected void executeMerge(IProgressMonitor monitor) throws CoreException {
super.executeMerge(monitor);
// Prune any empty folders within the traversals
@@ -93,7 +99,7 @@ public class ModelUpdateOperation extends AbstractModelMergeOperation {
CompoundResourceTraversal ct = new CompoundResourceTraversal();
ct.addTraversals(getContext().getScope().getTraversals());
IResource[] roots = ct.getRoots();
- List cvsResources = new ArrayList();
+ List<ICVSResource> cvsResources = new ArrayList<>();
for (int i = 0; i < roots.length; i++) {
IResource resource = roots[i];
if (resource.getProject().isAccessible()) {
@@ -102,7 +108,7 @@ public class ModelUpdateOperation extends AbstractModelMergeOperation {
}
new PruneFolderVisitor().visit(
CVSWorkspaceRoot.getCVSFolderFor(ResourcesPlugin.getWorkspace().getRoot()),
- (ICVSResource[]) cvsResources.toArray(new ICVSResource[cvsResources.size()]));
+ cvsResources.toArray(new ICVSResource[cvsResources.size()]));
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceChangeSetCapability.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceChangeSetCapability.java
index 0b39311c5..2b52f7c47 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceChangeSetCapability.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceChangeSetCapability.java
@@ -33,6 +33,7 @@ public class WorkspaceChangeSetCapability extends ModelParticipantChangeSetCapab
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.synchronize.ChangeSetCapability#supportsActiveChangeSets()
*/
+ @Override
public boolean supportsActiveChangeSets() {
return true;
}
@@ -40,6 +41,7 @@ public class WorkspaceChangeSetCapability extends ModelParticipantChangeSetCapab
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.synchronize.ChangeSetCapability#enableActiveChangeSetsFor(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration)
*/
+ @Override
public boolean enableActiveChangeSetsFor(ISynchronizePageConfiguration configuration) {
return supportsActiveChangeSets() &&
configuration.getMode() != ISynchronizePageConfiguration.INCOMING_MODE;
@@ -48,7 +50,8 @@ public class WorkspaceChangeSetCapability extends ModelParticipantChangeSetCapab
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.synchronize.ChangeSetCapability#createChangeSet(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration, org.eclipse.team.core.diff.IDiff[])
*/
- public ActiveChangeSet createChangeSet(ISynchronizePageConfiguration configuration, IDiff[] infos) {
+ @Override
+ public ActiveChangeSet createChangeSet(ISynchronizePageConfiguration configuration, IDiff[] infos) {
ActiveChangeSet set = getActiveChangeSetManager().createSet(CVSUIMessages.WorkspaceChangeSetCapability_1, new IDiff[0]);
CommitSetDialog dialog = new CommitSetDialog(configuration.getSite().getShell(), set, getResources(infos), CommitSetDialog.NEW);
dialog.open();
@@ -58,20 +61,21 @@ public class WorkspaceChangeSetCapability extends ModelParticipantChangeSetCapab
}
private IResource[] getResources(IDiff[] diffs) {
- Set result = new HashSet();
+ Set<IResource> result = new HashSet<>();
for (int i = 0; i < diffs.length; i++) {
IDiff diff = diffs[i];
IResource resource = ResourceDiffTree.getResourceFor(diff);
if (resource != null)
result.add(resource);
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ChangeSetCapability#editChangeSet(org.eclipse.team.core.subscribers.ActiveChangeSet)
*/
- public void editChangeSet(ISynchronizePageConfiguration configuration, ActiveChangeSet set) {
+ @Override
+ public void editChangeSet(ISynchronizePageConfiguration configuration, ActiveChangeSet set) {
CommitSetDialog dialog = new CommitSetDialog(configuration.getSite().getShell(), set, set.getResources(), CommitSetDialog.EDIT);
dialog.open();
if (dialog.getReturnCode() != Window.OK) return;
@@ -81,10 +85,12 @@ public class WorkspaceChangeSetCapability extends ModelParticipantChangeSetCapab
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ChangeSetCapability#getActiveChangeSetManager()
*/
- public ActiveChangeSetManager getActiveChangeSetManager() {
+ @Override
+ public ActiveChangeSetManager getActiveChangeSetManager() {
return CVSUIPlugin.getPlugin().getChangeSetManager();
}
+ @Override
public CheckedInChangeSetCollector createCheckedInChangeSetCollector(ISynchronizePageConfiguration configuration) {
return new CheckedInChangeSetCollector(configuration, CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber());
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java
index 5fbbc116e..ead6a4890 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java
@@ -483,7 +483,7 @@ public class WorkspaceSubscriberContext extends CVSSubscriberMergeContext implem
}
private ResourceTraversal[] getTraversals(IDiff[] deltas) {
- List result = new ArrayList();
+ List<IResource> result = new ArrayList<>();
for (int i = 0; i < deltas.length; i++) {
IDiff diff = deltas[i];
IResource resource = ResourceDiffTree.getResourceFor(diff);
@@ -492,7 +492,7 @@ public class WorkspaceSubscriberContext extends CVSSubscriberMergeContext implem
}
}
return new ResourceTraversal[] {
- new ResourceTraversal((IResource[]) result.toArray(new IResource[result.size()]), IResource.DEPTH_ZERO, IResource.NONE)
+ new ResourceTraversal(result.toArray(new IResource[result.size()]), IResource.DEPTH_ZERO, IResource.NONE)
};
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java
index 0f816f2d8..b9d1230ae 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java
@@ -36,15 +36,16 @@ public class RemoteContentProvider extends WorkbenchContentProvider {
IWorkingSet workingSet;
DeferredTreeContentManager manager;
- HashMap cachedTrees;
+ HashMap<ICVSRemoteFolder, RemoteFolderTree> cachedTrees;
public RemoteContentProvider(){
- cachedTrees = new HashMap();
+ cachedTrees = new HashMap<>();
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (viewer instanceof AbstractTreeViewer) {
manager = new DeferredTreeContentManager((AbstractTreeViewer) viewer);
@@ -52,6 +53,7 @@ public class RemoteContentProvider extends WorkbenchContentProvider {
super.inputChanged(viewer, oldInput, newInput);
}
+ @Override
public boolean hasChildren(Object element) {
// the + box will always appear, but then disappear
// if not needed after you first click on it.
@@ -101,6 +103,7 @@ public class RemoteContentProvider extends WorkbenchContentProvider {
/* (non-Javadoc)
* @see org.eclipse.ui.model.WorkbenchContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object element) {
//check to see if we already have the children cached in the tree map
Object tree = cachedTrees.get(element);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java
index 27e73c93f..b84009392 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java
@@ -13,14 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
+import java.util.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.resources.mapping.ResourceMapping;
@@ -30,9 +23,9 @@ import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
+import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
@@ -63,6 +56,7 @@ public class AddOperation extends RepositoryProviderOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#execute(org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException {
if (resources.length == 0)
return;
@@ -72,6 +66,7 @@ public class AddOperation extends RepositoryProviderOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getTaskName()
*/
+ @Override
protected String getTaskName() {
return CVSUIMessages.AddAction_adding;
}
@@ -79,6 +74,7 @@ public class AddOperation extends RepositoryProviderOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#getTaskName(org.eclipse.team.internal.ccvs.core.CVSTeamProvider)
*/
+ @Override
protected String getTaskName(CVSTeamProvider provider) {
return NLS.bind(CVSUIMessages.AddOperation_0, new String[] { provider.getProject().getName() });
}
@@ -111,10 +107,10 @@ public class AddOperation extends RepositoryProviderOperation {
// Visit the children of the resources using the depth in order to
// determine which folders, text files and binary files need to be added
// A TreeSet is needed for the folders so they are in the right order (i.e. parents created before children)
- final SortedSet folders = new TreeSet();
+ final SortedSet<ICVSResource> folders = new TreeSet<>();
// Sets are required for the files to ensure that files will not appear twice if there parent was added as well
// and the depth isn't zero
- final Map /* from KSubstOption to Set */ files = new HashMap();
+ final Map /* from KSubstOption to Set */<KSubstOption, Set> files = new HashMap<>();
final CVSException[] eHolder = new CVSException[1];
for (int i=0; i<resources.length; i++) {
@@ -133,6 +129,7 @@ public class AddOperation extends RepositoryProviderOperation {
// Auto-add children
final TeamException[] exception = new TeamException[] { null };
currentResource.accept(new IResourceVisitor() {
+ @Override
public boolean visit(IResource resource) {
try {
ICVSResource mResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
@@ -141,7 +138,7 @@ public class AddOperation extends RepositoryProviderOperation {
if (! isManaged(mResource) && (currentResource.equals(resource) || ! mResource.isIgnored())) {
if (resource.getType() == IResource.FILE) {
KSubstOption ksubst= getKSubstOption((IFile)resource);
- Set set = (Set) files.get(ksubst);
+ Set set = files.get(ksubst);
if (set == null) {
set = new HashSet();
files.put(ksubst, set);
@@ -182,7 +179,7 @@ public class AddOperation extends RepositoryProviderOperation {
session,
Command.NO_GLOBAL_OPTIONS,
Command.NO_LOCAL_OPTIONS,
- (ICVSResource[])folders.toArray(new ICVSResource[folders.size()]),
+ folders.toArray(new ICVSResource[folders.size()]),
null,
Policy.subMonitorFor(progress, 8));
if (status.getCode() == CVSStatus.SERVER_ERROR) {
@@ -235,6 +232,7 @@ public class AddOperation extends RepositoryProviderOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getErrorMessage(org.eclipse.core.runtime.IStatus[], int)
*/
+ @Override
protected String getErrorMessage(IStatus[] failures, int totalOperations) {
return CVSUIMessages.AddAction_addFailed;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
index fae9b9e04..0e2a58940 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
@@ -44,7 +44,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
private boolean involvesMultipleResources = false;
- private List errors = new ArrayList(); // of IStatus
+ private List<IStatus> errors = new ArrayList<>(); // of IStatus
protected static final IStatus OK = Status.OK_STATUS;
@@ -59,6 +59,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.TeamOperation#getJobName()
*/
+ @Override
protected String getJobName() {
return getTaskName();
}
@@ -66,6 +67,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#getOperationIcon()
*/
+ @Override
protected URL getOperationIcon() {
return Platform.find(CVSUIPlugin.getPlugin().getBundle(), new Path(ICVSUIConstants.ICON_PATH + ICVSUIConstants.IMG_CVS_PERSPECTIVE));
}
@@ -73,6 +75,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public final void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
startOperation();
try {
@@ -95,7 +98,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
}
protected void endOperation() throws CVSException {
- handleErrors((IStatus[]) errors.toArray(new IStatus[errors.size()]));
+ handleErrors(errors.toArray(new IStatus[errors.size()]));
}
/**
@@ -126,7 +129,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
}
protected IStatus[] getErrors() {
- return (IStatus[]) errors.toArray(new IStatus[errors.size()]);
+ return errors.toArray(new IStatus[errors.size()]);
}
/**
@@ -141,7 +144,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
*/
protected IStatus getLastError() {
Assert.isTrue(errors.size() > 0);
- IStatus status = (IStatus)errors.get(errors.size() - 1);
+ IStatus status = errors.get(errors.size() - 1);
return status;
}
@@ -183,7 +186,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
protected final void handleErrors(IStatus[] errors) throws CVSException {
// We are only concerned with reportable errors.
// Others will appear in the console
- List reportableErrors = new ArrayList();
+ List<IStatus> reportableErrors = new ArrayList<>();
for (int i = 0; i < errors.length; i++) {
IStatus status = errors[i];
if (isReportableError(status)) {
@@ -200,7 +203,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
}
}
if (!reportableErrors.isEmpty())
- asException((IStatus[]) reportableErrors.toArray(new IStatus[reportableErrors.size()]));
+ asException(reportableErrors.toArray(new IStatus[reportableErrors.size()]));
}
/**
@@ -282,6 +285,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.TeamOperation#getShell()
*/
+ @Override
public Shell getShell() {
// Use the shell assigned to the operation if possible
if (shell != null && !shell.isDisposed()) {
@@ -303,6 +307,7 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#canRunAsJob()
*/
+ @Override
protected boolean canRunAsJob() {
// Put CVS jobs in the background by default.
return true;
@@ -311,7 +316,8 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#isSameFamilyAs(org.eclipse.team.ui.TeamOperation)
*/
- protected boolean isSameFamilyAs(TeamOperation operation) {
+ @Override
+ protected boolean isSameFamilyAs(TeamOperation operation) {
// Trat all CVS operations as a single family
return operation instanceof CVSOperation;
}
@@ -323,12 +329,14 @@ public abstract class CVSOperation extends TeamOperation implements IShellProvid
protected IAction getShowConsoleAction() {
// Show the console as the goto action
return new Action(CVSUIMessages.CVSOperation_1) {
- public void run() {
+ @Override
+ public void run() {
CVSOutputConsole console = CVSUIPlugin.getPlugin().getConsole();
if (console != null)
console.show(true);
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return CVSUIMessages.CVSOperation_2;
}
};
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheBaseContentsOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheBaseContentsOperation.java
index 2e3988729..21a98048c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheBaseContentsOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheBaseContentsOperation.java
@@ -83,7 +83,7 @@ public class CacheBaseContentsOperation extends CacheTreeContentsOperation {
}
private IResource[] getFilesWithLocalChanges(IResource[] resources, boolean recurse) {
- ArrayList result = new ArrayList();
+ ArrayList<IResource> result = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
IDiff[] nodes = getTree().getDiffs(resource, recurse ? IResource.DEPTH_INFINITE: IResource.DEPTH_ONE);
@@ -94,7 +94,7 @@ public class CacheBaseContentsOperation extends CacheTreeContentsOperation {
}
}
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
private boolean isFileWithLocalChange(IDiff node) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheTreeContentsOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheTreeContentsOperation.java
index 61c410d69..86c554e43 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheTreeContentsOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CacheTreeContentsOperation.java
@@ -60,7 +60,7 @@ public abstract class CacheTreeContentsOperation extends SingleCommandOperation
}
private IResource[] getFilesWithUncachedContents(IResource[] resources, boolean recurse) {
- ArrayList result = new ArrayList();
+ ArrayList<IResource> result = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
IDiff[] nodes = tree.getDiffs(resource, recurse ? IResource.DEPTH_INFINITE: IResource.DEPTH_ONE);
@@ -71,7 +71,7 @@ public abstract class CacheTreeContentsOperation extends SingleCommandOperation
}
}
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
protected boolean needsContents(IDiff node) {
@@ -133,7 +133,7 @@ public abstract class CacheTreeContentsOperation extends SingleCommandOperation
*/
@Override
protected ICVSResource[] getCVSArguments(Session session, IResource[] resources) {
- List result = new ArrayList();
+ List<ICVSResource> result = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
try {
@@ -145,7 +145,7 @@ public abstract class CacheTreeContentsOperation extends SingleCommandOperation
}
}
- return (ICVSResource[]) result.toArray(new ICVSResource[result.size()]);
+ return result.toArray(new ICVSResource[result.size()]);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java
index 23770afdc..c62a72227 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java
@@ -131,7 +131,7 @@ public class CheckoutIntoOperation extends CheckoutOperation {
* could expand to multiple local folders witinb the given parent folder.
*/
private ICVSFolder[] prepareLocalFolders(Session session, ICVSRemoteFolder remoteFolder, ICVSFolder parentFolder, String localFolderName, IProgressMonitor monitor) throws CVSException {
- Set targetFolderSet = new HashSet();
+ Set<ICVSFolder> targetFolderSet = new HashSet<>();
monitor.beginTask(null, 30);
if (localFolderName == null) {
@@ -159,7 +159,7 @@ public class CheckoutIntoOperation extends CheckoutOperation {
targetFolderSet.add(parentFolder.getFolder(localFolderName));
}
- final ICVSFolder[] targetFolders = (ICVSFolder[]) targetFolderSet.toArray(new ICVSFolder[targetFolderSet.size()]);
+ final ICVSFolder[] targetFolders = targetFolderSet.toArray(new ICVSFolder[targetFolderSet.size()]);
// Ensure that the checkout will not conflict with existing resources
IStatus status = validateTargetFolders(remoteFolder, targetFolders, Policy.subMonitorFor(monitor, 10));
@@ -341,7 +341,7 @@ public class CheckoutIntoOperation extends CheckoutOperation {
}
// Add recurse option
- List localOptions = new ArrayList();
+ List<LocalOption> localOptions = new ArrayList<>();
if (!recurse)
localOptions.add(Command.DO_NOT_RECURSE);
if (localName != null) {
@@ -362,7 +362,7 @@ public class CheckoutIntoOperation extends CheckoutOperation {
// Perform the checkout
IStatus status = Command.CHECKOUT.execute(session,
Command.NO_GLOBAL_OPTIONS,
- (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]),
+ localOptions.toArray(new LocalOption[localOptions.size()]),
new String[] { remoteFolder.getRepositoryRelativePath() },
null,
Policy.subMonitorFor(monitor, 80));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
index cdfc3aff5..23d0c5845 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
@@ -194,7 +194,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
if (projects.length == 1) {
return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(projects[0]);
} else {
- Set rules = new HashSet();
+ Set<ISchedulingRule> rules = new HashSet<>();
for (int i = 0; i < projects.length; i++) {
ISchedulingRule modifyRule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(projects[i]);
if (modifyRule instanceof IResource && ((IResource)modifyRule).getType() == IResource.ROOT) {
@@ -204,7 +204,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
}
rules.add(modifyRule);
}
- return new MultiRule((ISchedulingRule[]) rules.toArray(new ISchedulingRule[rules.size()]));
+ return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
}
}
@@ -251,7 +251,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
try {
// Build the local options
- List localOptions = new ArrayList();
+ List<LocalOption> localOptions = new ArrayList<>();
// Add the option to load into the target project if one was supplied
if (project != null) {
localOptions.add(Checkout.makeDirectoryNameOption(project.getName()));
@@ -272,7 +272,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
// Perform the checkout
IStatus status = Command.CHECKOUT.execute(session,
Command.NO_GLOBAL_OPTIONS,
- (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]),
+ localOptions.toArray(new LocalOption[localOptions.size()]),
new String[]{getRemoteModuleName(resource)},
null,
Policy.subMonitorFor(pm, 90));
@@ -300,7 +300,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
*/
private IProject[] determineProjects(Session session, final ICVSRemoteFolder remoteFolder, IProject project, IProgressMonitor pm) throws CVSException {
- Set targetProjectSet = new HashSet();
+ Set<IProject> targetProjectSet = new HashSet<>();
String moduleName = getRemoteModuleName(remoteFolder);
if (project == null) {
@@ -336,7 +336,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
}
// Return the local projects affected by the checkout
- IProject[] targetProjects = (IProject[]) targetProjectSet.toArray(new IProject[targetProjectSet.size()]);
+ IProject[] targetProjects = targetProjectSet.toArray(new IProject[targetProjectSet.size()]);
return targetProjects;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutToRemoteFolderOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutToRemoteFolderOperation.java
index 89aae65a4..5d5a21bb7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutToRemoteFolderOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutToRemoteFolderOperation.java
@@ -14,9 +14,7 @@
package org.eclipse.team.internal.ccvs.ui.operations;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.osgi.util.NLS;
@@ -49,6 +47,7 @@ public class CheckoutToRemoteFolderOperation extends CheckoutOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.core.client.UpdatedHandler#receiveTargetFile(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.ICVSFile, java.lang.String, java.util.Date, boolean, boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void receiveTargetFile(
Session session,
ICVSFile mFile,
@@ -94,6 +93,7 @@ public class CheckoutToRemoteFolderOperation extends CheckoutOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.core.client.Command#commandFinished(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption[], org.eclipse.team.internal.ccvs.core.client.Command.LocalOption[], org.eclipse.team.internal.ccvs.core.ICVSResource[], org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IStatus)
*/
+ @Override
protected IStatus commandFinished(
Session session,
GlobalOption[] globalOptions,
@@ -110,6 +110,7 @@ public class CheckoutToRemoteFolderOperation extends CheckoutOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.core.client.Command#doExecute(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption[], org.eclipse.team.internal.ccvs.core.client.Command.LocalOption[], java.lang.String[], org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus doExecute(
Session session,
GlobalOption[] globalOptions,
@@ -148,6 +149,7 @@ public class CheckoutToRemoteFolderOperation extends CheckoutOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CheckoutOperation#checkout(org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus checkout(
ICVSRemoteFolder folder,
IProgressMonitor monitor)
@@ -167,6 +169,7 @@ public class CheckoutToRemoteFolderOperation extends CheckoutOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getTaskName()
*/
+ @Override
protected String getTaskName() {
return NLS.bind(CVSUIMessages.CheckoutToRemoteFolderOperation_0, new String[] { getRemoteFolders()[0].getName() });
}
@@ -181,7 +184,7 @@ public class CheckoutToRemoteFolderOperation extends CheckoutOperation {
session.open(Policy.subMonitorFor(pm, 5), false /* read-only */);
try {
// Build the local options
- List localOptions = new ArrayList();
+ List<LocalOption> localOptions = new ArrayList<>();
// Add the options related to the CVSTag
CVSTag tag = resource.getTag();
if (tag == null) {
@@ -194,7 +197,7 @@ public class CheckoutToRemoteFolderOperation extends CheckoutOperation {
// Perform the checkout
IStatus status = new SandboxCheckout().execute(session,
Command.NO_GLOBAL_OPTIONS,
- (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]),
+ localOptions.toArray(new LocalOption[localOptions.size()]),
new String[]{resource.getRepositoryRelativePath()},
null,
Policy.subMonitorFor(pm, 90));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java
index f46766657..5cfa92654 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java
@@ -213,8 +213,8 @@ public abstract class DiffOperation extends SingleCommandOperation {
protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException {
//add this project to the total projects encountered
- final HashSet newFiles = new HashSet(); //array of ICVSResource - need HashSet to guard for duplicate entries
- final HashSet existingFiles = new HashSet(); //array of IResource - need HashSet to guard for duplicate entries
+ final HashSet<ICVSFile> newFiles = new HashSet<>(); // need HashSet to guard for duplicate entries
+ final HashSet<IResource> existingFiles = new HashSet<>(); // need HashSet to guard for duplicate entries
monitor.beginTask(null,100);
final IProgressMonitor subMonitor = Policy.subMonitorFor(monitor,10);
@@ -249,7 +249,7 @@ public abstract class DiffOperation extends SingleCommandOperation {
}, recurse);
}
- final SortedSet allFiles = new TreeSet(COMPARATOR);
+ final SortedSet<Object> allFiles = new TreeSet<Object>(COMPARATOR);
allFiles.addAll(existingFiles);
allFiles.addAll(newFiles);
@@ -292,7 +292,7 @@ public abstract class DiffOperation extends SingleCommandOperation {
}
}
- List existingFilesSubList = new ArrayList();
+ List<Object> existingFilesSubList = new ArrayList<>();
for (Iterator iter = allFiles.iterator(); iter.hasNext();) {
Object file = iter.next();
if (existingFiles.contains(file)) {
@@ -335,7 +335,7 @@ public abstract class DiffOperation extends SingleCommandOperation {
*/
private void handleCVSException(CVSException ex) {
IStatus status = ex.getStatus();
- List toShow = new ArrayList();
+ List<IStatus> toShow = new ArrayList<>();
IStatus children[] = status.getChildren();
boolean may = true;
for (int i = 0; i < children.length; i++) {
@@ -356,7 +356,7 @@ public abstract class DiffOperation extends SingleCommandOperation {
new MultiStatus(
CVSProviderPlugin.ID,
CVSStatus.SERVER_ERROR,
- (IStatus[]) toShow.toArray(new IStatus[toShow.size()]),
+ toShow.toArray(new IStatus[toShow.size()]),
CVSUIMessages.DiffOperation_ErrorsOccurredWhileCreatingThePatch,
null));
adapter.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, msg);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FetchMembersOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FetchMembersOperation.java
index c5c715b44..a6b54bb35 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FetchMembersOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/FetchMembersOperation.java
@@ -15,6 +15,7 @@ package org.eclipse.team.internal.ccvs.ui.operations;
import java.util.ArrayList;
import java.util.List;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
@@ -22,7 +23,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderMemberFetcher;
-import org.eclipse.team.internal.ccvs.ui.*;
+import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.ui.IWorkbenchPart;
@@ -45,16 +46,18 @@ public class FetchMembersOperation extends RemoteOperation {
public class InternalRemoteFolderMemberFetcher extends RemoteFolderMemberFetcher {
long sendIncrement = 100;
- List unsent = new ArrayList();
+ List<RemoteFolder> unsent = new ArrayList<>();
long intervalStart;
protected InternalRemoteFolderMemberFetcher(RemoteFolder parentFolder, CVSTag tag) {
super(parentFolder, tag);
}
+ @Override
protected void parentDoesNotExist() {
super.parentDoesNotExist();
// Indicate that there are no children
collector.add(new Object[0], getProgressMonitor());
}
+ @Override
protected RemoteFolder recordFolder(String name) {
RemoteFolder folder = super.recordFolder(name);
unsent.add(folder);
@@ -67,19 +70,21 @@ public class FetchMembersOperation extends RemoteOperation {
long currentTime = System.currentTimeMillis();
return ((currentTime - intervalStart) > sendIncrement) || unsent.size() > sendIncrement;
}
+ @Override
protected IStatus performUpdate(IProgressMonitor progress, CVSTag tag) throws CVSException {
intervalStart = System.currentTimeMillis();
IStatus status = super.performUpdate(progress, tag);
sendFolders();
return status;
}
+ @Override
protected void updateFileRevisions(ICVSFile[] files, IProgressMonitor monitor) throws CVSException {
super.updateFileRevisions(files, monitor);
sendFiles();
}
private void sendFolders() {
updateParentFolderChildren();
- collector.add(filter.filter((ICVSRemoteFolder[]) unsent.toArray(new ICVSRemoteFolder[unsent.size()])), getProgressMonitor());
+ collector.add(filter.filter(unsent.toArray(new ICVSRemoteFolder[unsent.size()])), getProgressMonitor());
unsent.clear();
intervalStart = System.currentTimeMillis();
}
@@ -100,6 +105,7 @@ public class FetchMembersOperation extends RemoteOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void execute(IProgressMonitor monitor) throws CVSException, InterruptedException {
ICVSRemoteFolder remote = getRemoteFolder();
if (remote.getClass().equals(RemoteFolder.class)) {
@@ -133,6 +139,7 @@ public class FetchMembersOperation extends RemoteOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getTaskName()
*/
+ @Override
protected String getTaskName() {
return NLS.bind(CVSUIMessages.FetchMembersOperation_0, new String[] { getRemoteFolder().getName() });
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/OverrideAndUpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/OverrideAndUpdateOperation.java
index 5c8a94d28..c0dc51ceb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/OverrideAndUpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/OverrideAndUpdateOperation.java
@@ -41,22 +41,25 @@ public class OverrideAndUpdateOperation extends ReplaceOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation#getResourcesToUpdate(org.eclipse.team.internal.ccvs.core.ICVSResource[])
*/
+ @Override
protected ICVSResource[] getResourcesToUpdate(ICVSResource[] resources, IProgressMonitor monitor) throws CVSException {
// Add the conflicting additions to the list of resources to update
- Set update = new HashSet();
+ Set<ICVSResource> update = new HashSet<>();
ICVSResource[] conflicts = getCVSArguments(conflictingAdditions);
update.addAll(Arrays.asList(conflicts));
update.addAll(Arrays.asList(super.getResourcesToUpdate(resources, monitor)));
- return (ICVSResource[]) update.toArray(new ICVSResource[update.size()]);
+ return update.toArray(new ICVSResource[update.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.UpdateOperation#getResourceMappingContext()
*/
+ @Override
protected ResourceMappingContext getResourceMappingContext() {
return new SingleProjectSubscriberContext(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(), false, project);
}
+ @Override
protected SynchronizationScopeManager createScopeManager(boolean consultModels) {
return new SingleProjectScopeManager(getJobName(), getSelectedMappings(), getResourceMappingContext(), consultModels, project);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java
index b5eab3267..617a6f8a5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java
@@ -228,7 +228,7 @@ public class RemoteCompareOperation extends RemoteOperation {
private String[] getOverlappingFilePaths() {
String[] leftFiles = getFilePaths(leftTree);
String[] rightFiles = getFilePaths(rightTree);
- Set set = new HashSet();
+ Set<String> set = new HashSet<>();
for (int i = 0; i < rightFiles.length; i++) {
String rightFile = rightFiles[i];
for (int j = 0; j < leftFiles.length; j++) {
@@ -238,7 +238,7 @@ public class RemoteCompareOperation extends RemoteOperation {
}
}
}
- return (String[]) set.toArray(new String[set.size()]);
+ return set.toArray(new String[set.size()]);
}
private void fetchFileContents(RemoteFolderTree tree, String[] overlappingFilePaths, IProgressMonitor monitor) throws CVSException {
@@ -247,7 +247,7 @@ public class RemoteCompareOperation extends RemoteOperation {
private String[] getFilePaths(RemoteFolderTree tree) {
ICVSRemoteResource[] children = tree.getChildren();
- List result = new ArrayList();
+ List<String> result = new ArrayList<>();
for (int i = 0; i < children.length; i++) {
ICVSRemoteResource resource = children[i];
if (resource.isContainer()) {
@@ -256,7 +256,7 @@ public class RemoteCompareOperation extends RemoteOperation {
result.add(resource.getRepositoryRelativePath());
}
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java
index ba8e7b140..2c7ab5ea2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java
@@ -13,24 +13,15 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.ILogEntry;
-import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.RLog;
-import org.eclipse.team.internal.ccvs.core.client.Session;
+import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.client.*;
import org.eclipse.team.internal.ccvs.core.client.listeners.ILogEntryListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.LogListener;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
@@ -59,10 +50,13 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
/*
* Cache of all log entries
*/
- private Map entries = new HashMap(); /* Map String:remoteFilePath->Map (String:revision -> ILogEntry) */
+ private Map<String, Map<String, ILogEntry>> entries = new HashMap<>(); /*
+ * Map String:remoteFilePath->Map
+ * (String:revision -> ILogEntry)
+ */
- private Map internalGetLogEntries(String path) {
- return (Map)entries.get(path);
+ private Map<String, ILogEntry> internalGetLogEntries(String path) {
+ return entries.get(path);
}
/**
@@ -71,8 +65,8 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
* @return the log entries for the file
*/
public ILogEntry[] getLogEntries(String path) {
- Map map = internalGetLogEntries(path);
- return (ILogEntry[]) map.values().toArray(new ILogEntry[map.values().size()]);
+ Map<String, ILogEntry> map = internalGetLogEntries(path);
+ return map.values().toArray(new ILogEntry[map.values().size()]);
}
private ILogEntry internalGetLogEntry(String path, String revision) {
@@ -84,7 +78,7 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
}
public String[] getCachedFilePaths() {
- return (String[]) entries.keySet().toArray(new String[entries.size()]);
+ return entries.keySet().toArray(new String[entries.size()]);
}
/**
@@ -115,9 +109,9 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
* @return the fetched log entries or an empty list is none were found
*/
public synchronized ILogEntry[] getLogEntries(ICVSRemoteResource resource) {
- Map fileEntries = internalGetLogEntries(getFullPath(resource));
+ Map<String, ILogEntry> fileEntries = internalGetLogEntries(getFullPath(resource));
if (fileEntries != null) {
- return (ILogEntry[]) fileEntries.values().toArray(new ILogEntry[fileEntries.size()]);
+ return fileEntries.values().toArray(new ILogEntry[fileEntries.size()]);
}
return new ILogEntry[0];
}
@@ -226,13 +220,14 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.core.client.listeners.ILogEntryListener#addEntry(org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry)
*/
- public void handleLogEntryReceived(ILogEntry entry) {
+ @Override
+ public void handleLogEntryReceived(ILogEntry entry) {
ICVSRemoteFile file = entry.getRemoteFile();
String fullPath = getFullPath(file);
String revision = entry.getRevision();
- Map fileEntries = internalGetLogEntries(fullPath);
+ Map<String, ILogEntry> fileEntries = internalGetLogEntries(fullPath);
if (fileEntries == null) {
- fileEntries = new HashMap();
+ fileEntries = new HashMap<>();
entries.put(fullPath, fileEntries);
}
fileEntries.put(revision, entry);
@@ -249,6 +244,7 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryLocationOperation#execute(org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation, org.eclipse.team.internal.ccvs.core.ICVSRemoteResource[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void execute(ICVSRepositoryLocation location, ICVSRemoteResource[] remoteResources, IProgressMonitor monitor) throws CVSException {
monitor.beginTask(NLS.bind(CVSUIMessages.RemoteLogOperation_0, new String[] { location.getHost() }), 100);
Session s = new Session(location, CVSWorkspaceRoot.getCVSFolderFor(ResourcesPlugin.getWorkspace().getRoot()), false /* do not output to console */);
@@ -260,14 +256,14 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
if(tag1 == null || tag2 == null) {
// Optimize the cases were we are only fetching the history for a single revision. If it is
// already cached, don't fetch it again.
- ArrayList unCachedRemotes = new ArrayList();
+ ArrayList<ICVSRemoteResource> unCachedRemotes = new ArrayList<>();
for (int i = 0; i < remoteResources.length; i++) {
ICVSRemoteResource r = remoteResources[i];
if(entryCache.getLogEntry(r) == null) {
unCachedRemotes.add(r);
}
}
- remotes = (ICVSRemoteResource[]) unCachedRemotes.toArray(new ICVSRemoteResource[unCachedRemotes.size()]);
+ remotes = unCachedRemotes.toArray(new ICVSRemoteResource[unCachedRemotes.size()]);
}
if (remotes.length > 0) {
try {
@@ -283,6 +279,7 @@ public class RemoteLogOperation extends RepositoryLocationOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getTaskName()
*/
+ @Override
protected String getTaskName() {
return CVSUIMessages.RemoteLogOperation_1;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
index 2c6ee8083..f2640da71 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
@@ -136,7 +136,7 @@ public class ReplaceOperation extends UpdateOperation {
*/
protected ICVSResource[] getResourcesToUpdate(ICVSResource[] resources, IProgressMonitor monitor) throws CVSException {
// Accumulate the managed resources from the list of provided resources
- List managedResources = new ArrayList();
+ List<ICVSResource> managedResources = new ArrayList<>();
monitor.beginTask(null, resources.length * 100);
for (int i = 0; i < resources.length; i++) {
ICVSResource resource = resources[i];
@@ -150,10 +150,11 @@ public class ReplaceOperation extends UpdateOperation {
}
}
monitor.done();
- return (ICVSResource[]) managedResources.toArray(new ICVSResource[managedResources.size()]);
+ return managedResources.toArray(new ICVSResource[managedResources.size()]);
}
- private void addResourceIfTagExists(List managedResources, ICVSResource resource, IProgressMonitor monitor) {
+ private void addResourceIfTagExists(List<ICVSResource> managedResources, ICVSResource resource,
+ IProgressMonitor monitor) {
CVSTag tag = getTag();
if (tag == null || tag.getType() == CVSTag.DATE || tag.isHeadTag() || tag.isBaseTag()) {
// No need to check for date, head or base tags
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java
index 12e1095b8..cb58477e2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java
@@ -30,8 +30,8 @@ import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
import org.eclipse.team.core.mapping.provider.SynchronizationScopeManager;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
+import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -72,13 +72,13 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
// The provider for this entry
RepositoryProvider provider;
// Files are always shallow
- List files = new ArrayList();
+ List<IResource> files = new ArrayList<>();
// Not sure what to do with zero depth folders but we'll record them
- List zeroFolders = new ArrayList();
+ List<IResource> zeroFolders = new ArrayList<>();
// Non-recursive folder (-l)
- List shallowFolders = new ArrayList();
+ List<IResource> shallowFolders = new ArrayList<>();
// Recursive folders (-R)
- List deepFolders = new ArrayList();
+ List<IResource> deepFolders = new ArrayList<>();
public TraversalMapEntry(RepositoryProvider provider) {
this.provider = provider;
}
@@ -127,18 +127,19 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
* or if there are no shallow or deep folders.
* @return the resources that can be included in a shallow operation
*/
- public IResource[] getShallowResources() {
+ @Override
+ public IResource[] getShallowResources() {
if (shallowFolders.isEmpty() && deepFolders.isEmpty() && !files.isEmpty()) {
- return (IResource[]) files.toArray(new IResource[files.size()]);
+ return files.toArray(new IResource[files.size()]);
}
if (!shallowFolders.isEmpty()) {
if (files.isEmpty()) {
- return (IResource[]) shallowFolders.toArray(new IResource[shallowFolders.size()]);
+ return shallowFolders.toArray(new IResource[shallowFolders.size()]);
}
- List result = new ArrayList();
+ List<IResource> result = new ArrayList<>();
result.addAll(shallowFolders);
result.addAll(files);
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
return new IResource[0];
}
@@ -147,21 +148,23 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
* If there are no shallow folders, this will include any files.
* @return
*/
- public IResource[] getDeepResources() {
+ @Override
+ public IResource[] getDeepResources() {
if (deepFolders.isEmpty())
return new IResource[0];
if (!shallowFolders.isEmpty())
- return (IResource[]) deepFolders.toArray(new IResource[deepFolders.size()]);
- List result = new ArrayList();
+ return deepFolders.toArray(new IResource[deepFolders.size()]);
+ List<IResource> result = new ArrayList<>();
result.addAll(deepFolders);
result.addAll(files);
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
/**
* Return the folders that are depth zero
*/
- public IResource[] getNontraversedFolders() {
- return (IResource[]) zeroFolders.toArray(new IResource[zeroFolders.size()]);
+ @Override
+ public IResource[] getNontraversedFolders() {
+ return zeroFolders.toArray(new IResource[zeroFolders.size()]);
}
}
@@ -200,6 +203,7 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException {
try {
monitor.beginTask(null, 100);
@@ -213,6 +217,7 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
}
}
+ @Override
protected void endOperation() throws CVSException {
if (manager != null) {
manager.dispose();
@@ -323,7 +328,7 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
* shared with that provider.
*/
Map getProviderTraversalMapping(IProgressMonitor monitor) throws CoreException {
- Map result = new HashMap();
+ Map<RepositoryProvider, TraversalMapEntry> result = new HashMap<>();
ResourceMapping[] mappings = getScope().getMappings();
for (int j = 0; j < mappings.length; j++) {
ResourceMapping mapping = mappings[j];
@@ -333,7 +338,7 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
IProject project = projects[k];
RepositoryProvider provider = RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId());
if (provider != null) {
- TraversalMapEntry entry = (TraversalMapEntry)result.get(provider);
+ TraversalMapEntry entry = result.get(provider);
if (entry == null) {
entry = new TraversalMapEntry(provider);
result.put(provider, entry);
@@ -391,7 +396,7 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
* Get the arguments to be passed to a commit or update
*/
protected String[] getStringArguments(IResource[] resources) throws CVSException {
- List arguments = new ArrayList(resources.length);
+ List<String> arguments = new ArrayList<>(resources.length);
for (int i=0;i<resources.length;i++) {
IPath cvsPath = resources[i].getFullPath().removeFirstSegments(1);
if (cvsPath.segmentCount() == 0) {
@@ -400,7 +405,7 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
arguments.add(cvsPath.toString());
}
}
- return (String[])arguments.toArray(new String[arguments.size()]);
+ return arguments.toArray(new String[arguments.size()]);
}
protected ICVSRepositoryLocation getRemoteLocation(CVSTeamProvider provider) throws CVSException {
@@ -445,7 +450,8 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#isKeepOneProgressServiceEntry()
*/
- public boolean isKeepOneProgressServiceEntry() {
+ @Override
+ public boolean isKeepOneProgressServiceEntry() {
// Keep the last repository provider operation in the progress service
return true;
}
@@ -453,7 +459,8 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#getGotoAction()
*/
- protected IAction getGotoAction() {
+ @Override
+ protected IAction getGotoAction() {
return getShowConsoleAction();
}
@@ -464,13 +471,13 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
* @throws CoreException
*/
protected IResource[] getTraversalRoots() {
- List result = new ArrayList();
+ List<IResource> result = new ArrayList<>();
ResourceTraversal[] traversals = getTraversals();
for (int i = 0; i < traversals.length; i++) {
ResourceTraversal traversal = traversals[i];
result.addAll(Arrays.asList(traversal.getResources()));
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
index 3a9518101..cc0fd1d93 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ShowAnnotationOperation.java
@@ -171,14 +171,14 @@ public class ShowAnnotationOperation extends CVSOperation {
final Command.QuietOption quietness = CVSProviderPlugin.getPlugin().getQuietness();
try {
CVSProviderPlugin.getPlugin().setQuietness(Command.VERBOSE);
- List localOptions = new ArrayList();
+ List<Object> localOptions = new ArrayList<>();
if (revision != null) {
localOptions.add(Annotate.makeRevisionOption(revision));
}
if (fBinary) {
localOptions.add(Annotate.FORCE_BINARY_ANNOTATE);
}
- final IStatus status = Command.ANNOTATE.execute(session, Command.NO_GLOBAL_OPTIONS, (LocalOption[]) localOptions.toArray(new LocalOption[localOptions.size()]), new ICVSResource[]{cvsResource}, listener, Policy.subMonitorFor(monitor, 90));
+ final IStatus status = Command.ANNOTATE.execute(session, Command.NO_GLOBAL_OPTIONS, localOptions.toArray(new LocalOption[localOptions.size()]), new ICVSResource[]{cvsResource}, listener, Policy.subMonitorFor(monitor, 90));
if (status.getCode() == CVSStatus.SERVER_ERROR) {
throw new CVSServerException(status);
}
@@ -192,7 +192,7 @@ public class ShowAnnotationOperation extends CVSOperation {
}
private RevisionInformation createRevisionInformation(final AnnotateListener listener, IProgressMonitor monitor) throws CVSException {
- Map logEntriesByRevision= new HashMap();
+ Map<String, ILogEntry> logEntriesByRevision = new HashMap<>();
if (fCVSResource instanceof ICVSFile) {
try {
ILogEntry[] logEntries= ((ICVSFile) fCVSResource).getLogEntries(monitor);
@@ -241,14 +241,14 @@ public class ShowAnnotationOperation extends CVSOperation {
info.setHoverControlCreator(new AnnotationControlCreator(false));
info.setInformationPresenterControlCreator(new AnnotationControlCreator(true));
- HashMap sets= new HashMap();
+ HashMap<String, Revision> sets = new HashMap<>();
List annotateBlocks= listener.getCvsAnnotateBlocks();
for (Iterator blocks= annotateBlocks.iterator(); blocks.hasNext();) {
final CVSAnnotateBlock block= (CVSAnnotateBlock) blocks.next();
final String revisionString= block.getRevision();
- Revision revision= (Revision) sets.get(revisionString);
+ Revision revision= sets.get(revisionString);
if (revision == null) {
- final ILogEntry entry= (ILogEntry) logEntriesByRevision.get(revisionString);
+ final ILogEntry entry= logEntriesByRevision.get(revisionString);
if (entry == null)
continue;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java
index e52e7581b..64e91a3f6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java
@@ -14,9 +14,7 @@
package org.eclipse.team.internal.ccvs.ui.operations;
import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.*;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -36,17 +34,19 @@ import org.eclipse.ui.IWorkbenchPart;
public class TagOperation extends RepositoryProviderOperation implements ITagOperation {
- private Set localOptions = new HashSet();
+ private Set<LocalOption> localOptions = new HashSet<>();
private CVSTag tag;
public TagOperation(IWorkbenchPart part, ResourceMapping[] mappers) {
super(part, mappers);
}
+ @Override
public CVSTag getTag() {
return tag;
}
+ @Override
public void setTag(CVSTag tag) {
this.tag = tag;
}
@@ -54,6 +54,7 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#execute(org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException {
IStatus status = tag(provider, resources, recurse, monitor);
collectStatus(status);
@@ -62,6 +63,7 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/**
* Override to dislay the number of tag operations that succeeded
*/
+ @Override
protected String getErrorMessage(IStatus[] problems, int operationCount) {
// We accumulated 1 status per resource above.
if(operationCount == 1) {
@@ -84,7 +86,7 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
*/
public IStatus tag(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor progress) throws CVSException {
- LocalOption[] commandOptions = (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
+ LocalOption[] commandOptions = localOptions.toArray(new LocalOption[localOptions.size()]);
if (recurse) {
commandOptions = Command.DO_NOT_RECURSE.removeFrom(commandOptions);
} else {
@@ -122,6 +124,7 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#moveTag()
*/
+ @Override
public void moveTag() {
addLocalOption(Tag.FORCE_REASSIGNMENT);
}
@@ -129,10 +132,12 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#recurse()
*/
+ @Override
public void doNotRecurse() {
addLocalOption(Command.DO_NOT_RECURSE);
}
+ @Override
protected String getTaskName() {
return CVSUIMessages.TagFromWorkspace_taskName;
}
@@ -140,6 +145,7 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#getTaskName(org.eclipse.team.internal.ccvs.core.CVSTeamProvider)
*/
+ @Override
protected String getTaskName(CVSTeamProvider provider) {
return NLS.bind(CVSUIMessages.TagOperation_0, new String[] { provider.getProject().getName() });
}
@@ -147,6 +153,7 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException {
super.execute(monitor);
if (!errorsOccurred()) {
@@ -170,20 +177,22 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#getTagSource()
*/
- public TagSource getTagSource() {
+ @Override
+ public TagSource getTagSource() {
return TagSource.create(getProjects());
}
private IProject[] getProjects() {
ResourceMapping[] mappings = getSelectedMappings();
- Set projects = new HashSet();
+ Set<IProject> projects = new HashSet<>();
for (int i = 0; i < mappings.length; i++) {
ResourceMapping mapping = mappings[i];
projects.addAll(Arrays.asList(mapping.getProjects()));
}
- return (IProject[]) projects.toArray(new IProject[projects.size()]);
+ return projects.toArray(new IProject[projects.size()]);
}
+ @Override
protected boolean isReportableError(IStatus status) {
return super.isReportableError(status)
|| status.getCode() == CVSStatus.TAG_ALREADY_EXISTS;
@@ -192,7 +201,8 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#isEmpty()
*/
- public boolean isEmpty() {
+ @Override
+ public boolean isEmpty() {
return getSelectedMappings().length == 0;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOnlyMergableOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOnlyMergableOperation.java
index 2482d88cd..c8e5940b0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOnlyMergableOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOnlyMergableOperation.java
@@ -33,7 +33,7 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class UpdateOnlyMergableOperation extends SingleCommandOperation {
- List skippedFiles = new ArrayList();
+ List<IFile> skippedFiles = new ArrayList<>();
private final IProject project;
public UpdateOnlyMergableOperation(IWorkbenchPart part, IProject project, IResource[] resources, LocalOption[] localOptions) {
@@ -44,6 +44,7 @@ public class UpdateOnlyMergableOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation#executeCommand(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus executeCommand(Session session, CVSTeamProvider provider, ICVSResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException {
UpdateMergableOnly update = new UpdateMergableOnly();
IStatus status = update.execute(
@@ -63,6 +64,7 @@ public class UpdateOnlyMergableOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#getTaskName()
*/
+ @Override
protected String getTaskName() {
return CVSUIMessages.UpdateOnlyMergeable_taskName;
}
@@ -70,6 +72,7 @@ public class UpdateOnlyMergableOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#getTaskName(org.eclipse.team.internal.ccvs.core.CVSTeamProvider)
*/
+ @Override
protected String getTaskName(CVSTeamProvider provider) {
return NLS.bind(CVSUIMessages.UpdateOperation_0, new String[] { provider.getProject().getName() });
}
@@ -79,16 +82,18 @@ public class UpdateOnlyMergableOperation extends SingleCommandOperation {
}
public IFile[] getSkippedFiles() {
- return (IFile[]) skippedFiles.toArray(new IFile[skippedFiles.size()]);
+ return skippedFiles.toArray(new IFile[skippedFiles.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.UpdateOperation#getResourceMappingContext()
*/
+ @Override
protected ResourceMappingContext getResourceMappingContext() {
return new SingleProjectSubscriberContext(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(), false, project);
}
+ @Override
protected SynchronizationScopeManager createScopeManager(boolean consultModels) {
return new SingleProjectScopeManager(getJobName(), getSelectedMappings(), getResourceMappingContext(), consultModels, project);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java
index df107b173..abb1e78d9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java
@@ -13,9 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceMapping;
@@ -25,9 +23,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.subscribers.SubscriberResourceMappingContext;
import org.eclipse.team.internal.ccvs.core.*;
-import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.client.Update;
+import org.eclipse.team.internal.ccvs.core.client.*;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
@@ -67,6 +63,7 @@ public class UpdateOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation#executeCommand(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus executeCommand(
Session session,
CVSTeamProvider provider,
@@ -90,16 +87,17 @@ public class UpdateOperation extends SingleCommandOperation {
return execute;
}
- protected LocalOption[] getLocalOptions(boolean recurse) {
+ @Override
+ protected LocalOption[] getLocalOptions(boolean recurse) {
// Build the local options
- List localOptions = new ArrayList();
+ List<LocalOption> localOptions = new ArrayList<>();
// Use the appropriate tag options
if (tag != null) {
localOptions.add(Update.makeTagOption(tag));
}
// Build the arguments list
localOptions.addAll(Arrays.asList(super.getLocalOptions(recurse)));
- LocalOption[] commandOptions = (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
+ LocalOption[] commandOptions = localOptions.toArray(new LocalOption[localOptions.size()]);
return commandOptions;
}
@@ -110,6 +108,7 @@ public class UpdateOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getTaskName()
*/
+ @Override
protected String getTaskName() {
return CVSUIMessages.UpdateOperation_taskName; //;
}
@@ -117,6 +116,7 @@ public class UpdateOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#getTaskName(org.eclipse.team.internal.ccvs.core.CVSTeamProvider)
*/
+ @Override
protected String getTaskName(CVSTeamProvider provider) {
return NLS.bind(CVSUIMessages.UpdateOperation_0, new String[] { provider.getProject().getName() });
}
@@ -130,7 +130,8 @@ public class UpdateOperation extends SingleCommandOperation {
return null;
}
- protected boolean isReportableError(IStatus status) {
+ @Override
+ protected boolean isReportableError(IStatus status) {
return super.isReportableError(status)
|| status.getCode() == CVSStatus.UNMEGERED_BINARY_CONFLICT
|| status.getCode() == CVSStatus.INVALID_LOCAL_RESOURCE_PATH
@@ -140,6 +141,7 @@ public class UpdateOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getErrorMessage(org.eclipse.core.runtime.IStatus[], int)
*/
+ @Override
protected String getErrorMessage(IStatus[] failures, int totalOperations) {
return CVSUIMessages.UpdateAction_update;
}
@@ -147,7 +149,8 @@ public class UpdateOperation extends SingleCommandOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#getResourceMappingContext()
*/
- protected ResourceMappingContext getResourceMappingContext() {
+ @Override
+ protected ResourceMappingContext getResourceMappingContext() {
return SubscriberResourceMappingContext.createContext(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber());
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java
index 4794de2b4..4cacf52ec 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java
@@ -45,34 +45,39 @@ public final class WorkspaceResourceMapper extends ResourceMapping {
* @return a resource mappers that traverses the resources
*/
public static ResourceMapping[] asResourceMappers(final IResource[] resources, int depth) {
- List result = new ArrayList();
+ List<WorkspaceResourceMapper> result = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
result.add(new WorkspaceResourceMapper(resource, depth));
}
- return (ResourceMapping[]) result.toArray(new ResourceMapping[result.size()]);
+ return result.toArray(new ResourceMapping[result.size()]);
}
public WorkspaceResourceMapper(IResource resource, int depth) {
this.resource = resource;
this.depth = depth;
}
- public Object getModelObject() {
+ @Override
+ public Object getModelObject() {
return resource;
}
- public IProject[] getProjects() {
+ @Override
+ public IProject[] getProjects() {
return new IProject[] { resource.getProject() };
}
- public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
+ @Override
+ public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
return asTraversal(resource, depth, context);
}
private ResourceTraversal[] asTraversal(IResource resource, final int depth, ResourceMappingContext context) {
return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { resource }, depth, IResource.NONE)} ;
}
- public boolean contains(ResourceMapping mapping) {
+ @Override
+ public boolean contains(ResourceMapping mapping) {
return false;
}
+ @Override
public String getModelProviderId() {
return ModelProvider.RESOURCE_MODEL_PROVIDER_ID;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
index 3d16bf0c0..29814778a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryManager.java
@@ -60,9 +60,9 @@ public class RepositoryManager {
static final String ELEMENT_COMMIT_HISTORY = "CommitComments"; //$NON-NLS-1$
static final String ELEMENT_COMMENT_TEMPLATES = "CommitCommentTemplates"; //$NON-NLS-1$
- private Map repositoryRoots = new HashMap();
+ private Map<String, RepositoryRoot> repositoryRoots = new HashMap<>();
- List listeners = new ArrayList();
+ List<IRepositoryListener> listeners = new ArrayList<>();
// The previously remembered comment
static String[] previousComments = new String[0];
@@ -72,7 +72,7 @@ public class RepositoryManager {
// Cache of changed repository roots
private int notificationLevel = 0;
- private Map changedRepositories = new HashMap();
+ private Map<String, ICVSRepositoryLocation> changedRepositories = new HashMap<>();
public static final int DEFAULT_MAX_COMMENTS = 10;
@@ -102,14 +102,14 @@ public class RepositoryManager {
* @return RepositoryRoot[]
*/
private RepositoryRoot[] getRepositoryRoots(ICVSRepositoryLocation[] locations) {
- List roots = new ArrayList();
+ List<RepositoryRoot> roots = new ArrayList<>();
for (int i = 0; i < locations.length; i++) {
ICVSRepositoryLocation location = locations[i];
RepositoryRoot root = getRepositoryRootFor(location);
if (root != null)
roots.add(root);
}
- return (RepositoryRoot[]) roots.toArray(new RepositoryRoot[roots.size()]);
+ return roots.toArray(new RepositoryRoot[roots.size()]);
}
public RepositoryRoot[] getKnownRepositoryRoots() {
@@ -122,14 +122,14 @@ public class RepositoryManager {
public CVSTag[] getKnownTags(ICVSFolder project, int tagType) {
try {
CVSTag[] tags = getKnownTags(project);
- Set result = new HashSet();
+ Set<CVSTag> result = new HashSet<>();
for (int i = 0; i < tags.length; i++) {
CVSTag tag = tags[i];
if (tag.getType() == tagType)
result.add(tag);
}
- return (CVSTag[])result.toArray(new CVSTag[result.size()]);
+ return result.toArray(new CVSTag[result.size()]);
} catch(CVSException e) {
CVSUIPlugin.log(e);
return new CVSTag[0];
@@ -140,8 +140,8 @@ public class RepositoryManager {
* Get the list of known version tags for a given project.
*/
public CVSTag[] getKnownTags(ICVSRepositoryLocation location, int tagType) {
- Set result = new HashSet();
- RepositoryRoot root = (RepositoryRoot)repositoryRoots.get(location.getLocation(false));
+ Set<CVSTag> result = new HashSet<>();
+ RepositoryRoot root = repositoryRoots.get(location.getLocation(false));
if (root != null) {
CVSTag[] tags = root.getAllKnownTags();
for (int i = 0; i < tags.length; i++) {
@@ -150,7 +150,7 @@ public class RepositoryManager {
result.add(tag);
}
}
- return (CVSTag[])result.toArray(new CVSTag[0]);
+ return result.toArray(new CVSTag[0]);
}
/**
@@ -167,12 +167,12 @@ public class RepositoryManager {
}
ICVSRemoteResource[] folders = getFoldersForTag(repository, CVSTag.DEFAULT, monitor);
folders = filterResources(set, folders);
- Set tags = new HashSet();
+ Set<CVSTag> tags = new HashSet<>();
for (int i = 0; i < folders.length; i++) {
ICVSRemoteFolder folder = (ICVSRemoteFolder)folders[i];
tags.addAll(Arrays.asList(getKnownTags(folder, tagType)));
}
- return (CVSTag[]) tags.toArray(new CVSTag[tags.size()]);
+ return tags.toArray(new CVSTag[tags.size()]);
}
public CVSTag[] getKnownTags(ICVSFolder project) throws CVSException {
@@ -185,12 +185,12 @@ public class RepositoryManager {
* XXX I hope this methos is not needed in this form
*/
public Map getKnownProjectsAndVersions(ICVSRepositoryLocation location) {
- Map knownTags = new HashMap();
+ Map<String, Set<CVSTag>> knownTags = new HashMap<>();
RepositoryRoot root = getRepositoryRootFor(location);
String[] paths = root.getKnownRemotePaths();
for (int i = 0; i < paths.length; i++) {
String path = paths[i];
- Set result = new HashSet();
+ Set<CVSTag> result = new HashSet<>();
result.addAll(Arrays.asList(root.getAllKnownTags(path)));
knownTags.put(path, result);
}
@@ -219,7 +219,7 @@ public class RepositoryManager {
System.arraycopy(modules, 0, result, resources.length, modules.length);
return result;
}
- Set result = new HashSet();
+ Set<ICVSRemoteFolder> result = new HashSet<>();
// Get the tags for the location
RepositoryRoot root = getRepositoryRootFor(location);
String[] paths = root.getRemoteChildrenForTag(null, tag);
@@ -229,7 +229,7 @@ public class RepositoryManager {
Policy.subMonitorFor(monitor, 100));
result.add(remote);
}
- return (ICVSRemoteResource[])result.toArray(new ICVSRemoteResource[result.size()]);
+ return result.toArray(new ICVSRemoteResource[result.size()]);
} finally {
monitor.done();
}
@@ -263,7 +263,7 @@ public class RepositoryManager {
return new ICVSRemoteResource[0];
}
monitor = Policy.monitorFor(monitor);
- Set result = new HashSet();
+ Set<ICVSRemoteFolder> result = new HashSet<>();
RepositoryRoot root = getRepositoryRootFor(location);
// if remote folder is null return the subfolders of repository root
String[] paths = root.getRemoteChildrenForTag(
@@ -282,7 +282,7 @@ public class RepositoryManager {
Policy.subMonitorFor(monitor, 10));
result.add(remote);
}
- return (ICVSRemoteResource[]) result
+ return result
.toArray(new ICVSRemoteResource[result.size()]);
} finally {
monitor.done();
@@ -317,7 +317,7 @@ public class RepositoryManager {
* Remove the tags defined for this root and notify any listeners
*/
public void rootRemoved(ICVSRepositoryLocation root) {
- RepositoryRoot repoRoot = (RepositoryRoot)repositoryRoots.remove(root.getLocation(false));
+ RepositoryRoot repoRoot = repositoryRoots.remove(root.getLocation(false));
if (repoRoot != null)
broadcastRepositoryChange(repoRoot);
}
@@ -571,12 +571,12 @@ public class RepositoryManager {
if (projSize > 0) {
for (int j = 0; j < projSize; j++) {
String name = dis.readUTF();
- Set tagSet = new HashSet();
+ Set<CVSTag> tagSet = new HashSet<>();
int numTags = dis.readInt();
for (int k = 0; k < numTags; k++) {
tagSet.add(new CVSTag(dis.readUTF(), CVSTag.VERSION));
}
- CVSTag[] tags = (CVSTag[]) tagSet.toArray(new CVSTag[tagSet.size()]);
+ CVSTag[] tags = tagSet.toArray(new CVSTag[tagSet.size()]);
repoRoot.addTags(name, tags);
}
}
@@ -587,12 +587,12 @@ public class RepositoryManager {
if (projSize > 0) {
for (int j = 0; j < projSize; j++) {
String name = dis.readUTF();
- Set filenames = new HashSet();
+ Set<String> filenames = new HashSet<>();
int numFilenames = dis.readInt();
for (int k = 0; k < numFilenames; k++) {
filenames.add(name + "/" + dis.readUTF()); //$NON-NLS-1$
}
- repoRoot.setAutoRefreshFiles(name, (String[]) filenames.toArray(new String[filenames.size()]));
+ repoRoot.setAutoRefreshFiles(name, filenames.toArray(new String[filenames.size()]));
}
}
} catch (EOFException e) {
@@ -713,7 +713,7 @@ public class RepositoryManager {
}
public RepositoryRoot getRepositoryRootFor(ICVSRepositoryLocation location) {
- RepositoryRoot root = (RepositoryRoot)repositoryRoots.get(location.getLocation(false));
+ RepositoryRoot root = repositoryRoots.get(location.getLocation(false));
if (root == null) {
root = new RepositoryRoot(location);
add(root);
@@ -763,8 +763,8 @@ public class RepositoryManager {
notificationLevel = Math.max(0, notificationLevel - 1);
if (notificationLevel == 0) {
try {
- Collection roots = changedRepositories.values();
- broadcastRepositoriesChanged((ICVSRepositoryLocation[]) roots.toArray(new ICVSRepositoryLocation[roots.size()]));
+ Collection<ICVSRepositoryLocation> roots = changedRepositories.values();
+ broadcastRepositoriesChanged(roots.toArray(new ICVSRepositoryLocation[roots.size()]));
} finally {
changedRepositories.clear();
}
@@ -793,7 +793,7 @@ public class RepositoryManager {
if (workingSet == null) return resources;
// get the projects associated with the working set
IAdaptable[] adaptables = workingSet.getElements();
- Set projects = new HashSet();
+ Set<IProject> projects = new HashSet<>();
for (int i = 0; i < adaptables.length; i++) {
IAdaptable adaptable = adaptables[i];
Object adapted = adaptable.getAdapter(IResource.class);
@@ -803,7 +803,7 @@ public class RepositoryManager {
projects.add(project);
}
}
- List result = new ArrayList();
+ List<ICVSRemoteResource> result = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
ICVSRemoteResource resource = resources[i];
for (Iterator iter = projects.iterator(); iter.hasNext();) {
@@ -814,7 +814,7 @@ public class RepositoryManager {
}
}
}
- return (ICVSRemoteResource[]) result.toArray(new ICVSRemoteResource[result.size()]);
+ return result.toArray(new ICVSRemoteResource[result.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
index 9fc79c056..e1e4bc53d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
@@ -38,19 +38,19 @@ public class RepositoryRoot extends PlatformObject {
String name;
TagCacheEntry rootTagCacheEntry = new TagCacheEntry(Path.ROOT, null);
// Map of String (remote folder path) -> Set (file paths that are project relative)
- Map autoRefreshFiles = new HashMap();
+ Map<String, Set<String>> autoRefreshFiles = new HashMap<>();
// Map of String (module name) -> ICVSRemoteFolder (that is a defined module)
Map modulesCache;
Object modulesCacheLock = new Object();
// List of date tags
- List dateTags = new ArrayList();
+ List<CVSTag> dateTags = new ArrayList<>();
public static class TagCacheEntry {
IPath path;
// Set of tags found for this path
- private Set tags = new HashSet();
+ private Set<CVSTag> tags = new HashSet<>();
// String(last path segment) -> TagCacheEntry for child paths
- Map children = new HashMap();
+ Map<String, TagCacheEntry> children = new HashMap<>();
TagCacheEntry parent;
long lastAccessTime;
private static final int CACHE_LIFESPAN_IN_DAYS = 7;
@@ -61,7 +61,7 @@ public class RepositoryRoot extends PlatformObject {
accessed();
}
- public Set getTags() {
+ public Set<CVSTag> getTags() {
accessed();
return tags;
}
@@ -265,7 +265,7 @@ public class RepositoryRoot extends PlatformObject {
* @return the list of date tags
*/
public CVSTag[] getDateTags() {
- return (CVSTag[]) dateTags.toArray(new CVSTag[dateTags.size()]);
+ return dateTags.toArray(new CVSTag[dateTags.size()]);
}
/**
@@ -332,20 +332,20 @@ public class RepositoryRoot extends PlatformObject {
* @return String[]
*/
public String[] getAutoRefreshFiles(String remotePath) {
- Set files = (Set) autoRefreshFiles.get(remotePath);
+ Set<String> files = autoRefreshFiles.get(remotePath);
if (files == null || files.isEmpty()) {
// convert the default relative file paths to full paths
if (isDefinedModuleName(remotePath)) {
return new String[0];
}
- List result = new ArrayList();
+ List<String> result = new ArrayList<>();
for (int i = 0; i < DEFAULT_AUTO_REFRESH_FILES.length; i++) {
String relativePath = DEFAULT_AUTO_REFRESH_FILES[i];
result.add(new Path(null, remotePath).append(relativePath).toString());
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
} else {
- return (String[]) files.toArray(new String[files.size()]);
+ return files.toArray(new String[files.size()]);
}
}
@@ -356,7 +356,7 @@ public class RepositoryRoot extends PlatformObject {
* @param autoRefreshFiles The autoRefreshFiles to set
*/
public void setAutoRefreshFiles(String remotePath, String[] autoRefreshFiles) {
- Set newFiles = new HashSet(Arrays.asList(autoRefreshFiles));
+ Set<String> newFiles = new HashSet<>(Arrays.asList(autoRefreshFiles));
// Check to see if the auto-refresh files are the default files
if (autoRefreshFiles.length == DEFAULT_AUTO_REFRESH_FILES.length) {
boolean isDefault = true;
@@ -403,7 +403,7 @@ public class RepositoryRoot extends PlatformObject {
return tags;
}
if (recurse) {
- Set tagsSet = new HashSet();
+ Set<CVSTag> tagsSet = new HashSet<>();
folder.fetchChildren(Policy.subMonitorFor(monitor, 10));
ICVSResource[] children = folder
.members(ICVSFolder.FOLDER_MEMBERS);
@@ -413,7 +413,7 @@ public class RepositoryRoot extends PlatformObject {
.subMonitorFor(monitor,
100 / children.length))));
}
- tags = (CVSTag[]) tagsSet.toArray(new CVSTag[tagsSet.size()]);
+ tags = tagsSet.toArray(new CVSTag[tagsSet.size()]);
}
return tags;
} finally {
@@ -424,7 +424,8 @@ public class RepositoryRoot extends PlatformObject {
private CVSTag[] fetchTagsUsingLog(ICVSFolder folder, IProgressMonitor monitor) throws CVSException {
LogEntryCache logEntries = new LogEntryCache();
RemoteLogOperation operation = new RemoteLogOperation(null, new ICVSRemoteResource[] { asRemoteResource(folder) }, null, null, logEntries) {
- protected Command.LocalOption[] getLocalOptions(CVSTag tag1,CVSTag tag2) {
+ @Override
+ protected Command.LocalOption[] getLocalOptions(CVSTag tag1,CVSTag tag2) {
Command.LocalOption[] options = new Command.LocalOption[] {};
Command.LocalOption[] newOptions = new Command.LocalOption[options.length + 1];
System.arraycopy(options, 0, newOptions, 0, options.length);
@@ -440,7 +441,7 @@ public class RepositoryRoot extends PlatformObject {
// Ignore;
}
String[] keys = logEntries.getCachedFilePaths();
- Set tags = new HashSet();
+ Set<CVSTag> tags = new HashSet<>();
for (int i = 0; i < keys.length; i++) {
String key = keys[i];
ILogEntry[] entries = logEntries.getLogEntries(key);
@@ -449,7 +450,7 @@ public class RepositoryRoot extends PlatformObject {
tags.addAll(Arrays.asList(entry.getTags()));
}
}
- return (CVSTag[]) tags.toArray(new CVSTag[tags.size()]);
+ return tags.toArray(new CVSTag[tags.size()]);
}
private ICVSRemoteResource asRemoteResource(ICVSFolder folder) throws CVSException {
@@ -467,7 +468,7 @@ public class RepositoryRoot extends PlatformObject {
String[] filesToRefresh = getAutoRefreshFiles(remotePath);
try {
monitor.beginTask(null, filesToRefresh.length * 10);
- List tags = new ArrayList();
+ List<CVSTag> tags = new ArrayList<>();
for (int i = 0; i < filesToRefresh.length; i++) {
ICVSRemoteFile file = root.getRemoteFile(filesToRefresh[i], CVSTag.DEFAULT);
try {
@@ -487,7 +488,7 @@ public class RepositoryRoot extends PlatformObject {
}
}
}
- return (CVSTag[]) tags.toArray(new CVSTag[tags.size()]);
+ return tags.toArray(new CVSTag[tags.size()]);
} finally {
monitor.done();
}
@@ -497,7 +498,7 @@ public class RepositoryRoot extends PlatformObject {
* Returns Branch and Version tags for the given files
*/
private CVSTag[] fetchTags(ICVSRemoteFile file, IProgressMonitor monitor) throws TeamException {
- Set tagSet = new HashSet();
+ Set<CVSTag> tagSet = new HashSet<>();
ILogEntry[] entries = file.getLogEntries(monitor);
for (int j = 0; j < entries.length; j++) {
CVSTag[] tags = entries[j].getTags();
@@ -505,7 +506,7 @@ public class RepositoryRoot extends PlatformObject {
tagSet.add(tags[k]);
}
}
- return (CVSTag[])tagSet.toArray(new CVSTag[0]);
+ return tagSet.toArray(new CVSTag[0]);
}
private TagCacheEntry getTagCacheEntryFor(String remotePath, boolean create) {
@@ -514,7 +515,7 @@ public class RepositoryRoot extends PlatformObject {
for (int i = 0; i < segments.length; i++) {
String segment = segments[i];
if (currentTagCacheEntry.children.containsKey(segment)) {
- currentTagCacheEntry = (TagCacheEntry) currentTagCacheEntry.children
+ currentTagCacheEntry = currentTagCacheEntry.children
.get(segment);
continue;
}
@@ -536,7 +537,7 @@ public class RepositoryRoot extends PlatformObject {
for (int i = 0; i < segments.length; i++) {
String segment = segments[i];
if (currentTagCacheEntry.children.containsKey(segment)) {
- currentTagCacheEntry = (TagCacheEntry) currentTagCacheEntry.children
+ currentTagCacheEntry = currentTagCacheEntry.children
.get(segment);
} else {
break; // we reached the last existing parent
@@ -596,7 +597,7 @@ public class RepositoryRoot extends PlatformObject {
*/
public void writeState(XMLWriter writer) {
- HashMap attributes = new HashMap();
+ HashMap<String, String> attributes = new HashMap<>();
attributes.clear();
attributes.put(RepositoriesViewContentHandler.ID_ATTRIBUTE, root.getLocation(false));
@@ -642,7 +643,7 @@ public class RepositoryRoot extends PlatformObject {
writeATag(writer, attributes, tag, RepositoriesViewContentHandler.TAG_TAG);
}
}
- Set refreshSet = (Set)autoRefreshFiles.get(path);
+ Set refreshSet = autoRefreshFiles.get(path);
if (refreshSet != null) {
Iterator filenameIt = refreshSet.iterator();
while (filenameIt.hasNext()) {
@@ -664,14 +665,14 @@ public class RepositoryRoot extends PlatformObject {
writer.startAndEndTag(s, attributes, true);
}
- private void addAllKnownTagsForParents(TagCacheEntry entry, Set tags) {
+ private void addAllKnownTagsForParents(TagCacheEntry entry, Set<CVSTag> tags) {
if (entry.parent != null) {
addAllKnownTagsForParents(entry.parent, tags);
}
tags.addAll(entry.getTags());
}
- private void addAllKnownTagsForChildren(TagCacheEntry entry, Set tags) {
+ private void addAllKnownTagsForChildren(TagCacheEntry entry, Set<CVSTag> tags) {
Iterator childrenIterator = entry.getChildrenIterator();
while (childrenIterator.hasNext()) {
TagCacheEntry child = (TagCacheEntry) childrenIterator.next();
@@ -686,20 +687,20 @@ public class RepositoryRoot extends PlatformObject {
* @return CVSTag[]
*/
public CVSTag[] getAllKnownTags(String remotePath) {
- Set tags = new HashSet(dateTags);
+ Set<CVSTag> tags = new HashSet<>(dateTags);
addAllKnownTagsForParents(getKnownParentTagCacheEntryFor(remotePath),
tags);
TagCacheEntry entry = getTagCacheEntryFor(remotePath, false);
if (entry != null) {
addAllKnownTagsForChildren(entry, tags);
}
- return (CVSTag[]) tags.toArray(new CVSTag[tags.size()]);
+ return tags.toArray(new CVSTag[tags.size()]);
}
public CVSTag[] getAllKnownTags() {
- Set tags = new HashSet(dateTags);
+ Set<CVSTag> tags = new HashSet<>(dateTags);
addAllKnownTagsForChildren(rootTagCacheEntry, tags);
- return (CVSTag[]) tags.toArray(new CVSTag[tags.size()]);
+ return tags.toArray(new CVSTag[tags.size()]);
}
public String[] getRemoteChildrenForTag(String remotePath, CVSTag tag) {
@@ -713,7 +714,7 @@ public class RepositoryRoot extends PlatformObject {
return new String[0];
}
- Set paths = new HashSet();
+ Set<String> paths = new HashSet<>();
Iterator childrenIterator = entry.getChildrenIterator();
while (childrenIterator.hasNext()) {
TagCacheEntry child = (TagCacheEntry) childrenIterator.next();
@@ -723,11 +724,11 @@ public class RepositoryRoot extends PlatformObject {
paths.add(child.path.toString());
}
}
- return (String[]) paths.toArray(new String[paths.size()]);
+ return paths.toArray(new String[paths.size()]);
}
private Set getKnownRemotePaths(TagCacheEntry entry) {
- Set paths = new HashSet();
+ Set<String> paths = new HashSet<>();
Iterator childrenIterator = entry.getChildrenIterator();
while (childrenIterator.hasNext()) {
paths.addAll(getKnownRemotePaths((TagCacheEntry) childrenIterator
@@ -743,6 +744,7 @@ public class RepositoryRoot extends PlatformObject {
return (String[]) paths.toArray(new String[paths.size()]);
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
if (ICVSRepositoryLocation.class.equals(adapter)) return adapter.cast(getRoot());
return super.getAdapter(adapter);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java
index 2091ce88a..54e64690d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java
@@ -14,11 +14,7 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
@@ -32,7 +28,8 @@ import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Util;
-import org.eclipse.team.internal.ccvs.ui.*;
+import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.team.internal.ccvs.ui.mappings.ModelCompareParticipant;
@@ -105,12 +102,12 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
* This list is only modified and accessed from the event processing
* thread.
*/
- private final List updates = new ArrayList();
+ private final List<Event> updates = new ArrayList<>();
/*
* The accumulated list of fetches that have been requested
*/
- private final List fetches = new ArrayList();
+ private final List<Event> fetches = new ArrayList<>();
private final ISynchronizePageConfiguration configuration;
@@ -141,18 +138,21 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#remove(org.eclipse.core.resources.IResource)
*/
- protected void remove(IResource resource) {
+ @Override
+ protected void remove(IResource resource) {
queueEvent(new ResourceEvent(resource, REMOVAL, IResource.DEPTH_INFINITE), false /* do not put in on the front of the queue*/);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#change(org.eclipse.core.resources.IResource, int)
*/
- protected void change(IResource resource, int depth) {
+ @Override
+ protected void change(IResource resource, int depth) {
queueEvent(new ResourceEvent(resource, CHANGE, depth), false /* do not put in on the front of the queue*/);
}
- protected boolean hasMembers(IResource resource) {
+ @Override
+ protected boolean hasMembers(IResource resource) {
return collectedInfos.hasMembers(resource);
}
}
@@ -212,14 +212,16 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.BackgroundEventHandler#getJobFamiliy()
*/
- protected Object getJobFamiliy() {
+ @Override
+ protected Object getJobFamiliy() {
return ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION;
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.BackgroundEventHandler#createEventHandlingJob()
*/
- protected void createEventHandlingJob() {
+ @Override
+ protected void createEventHandlingJob() {
super.createEventHandlingJob();
Job job = getEventHandlerJob();
job.setSystem(false);
@@ -229,7 +231,8 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.BackgroundEventHandler#processEvent(org.eclipse.team.internal.core.BackgroundEventHandler.Event, org.eclipse.core.runtime.IProgressMonitor)
*/
- protected void processEvent(Event event, IProgressMonitor monitor) throws CoreException {
+ @Override
+ protected void processEvent(Event event, IProgressMonitor monitor) throws CoreException {
Policy.checkCanceled(monitor);
switch (event.getType()) {
case REMOVAL:
@@ -248,7 +251,8 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.BackgroundEventHandler#doDispatchEvents(org.eclipse.core.runtime.IProgressMonitor)
*/
- protected boolean doDispatchEvents(IProgressMonitor monitor) throws TeamException {
+ @Override
+ protected boolean doDispatchEvents(IProgressMonitor monitor) throws TeamException {
Policy.checkCanceled(monitor);
boolean dispatched = false;
monitor.beginTask(null, 50);
@@ -288,7 +292,8 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.BackgroundEventHandler#shutdown()
*/
- public void shutdown() {
+ @Override
+ public void shutdown() {
super.shutdown();
collector.dispose();
// Probably not necessary as GC would take care of it but we'll do it anyway
@@ -426,7 +431,8 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
/* (non-Javadoc)
* @see org.eclipse.team.internal.core.BackgroundEventHandler#queueEvent(org.eclipse.team.internal.core.BackgroundEventHandler.Event, boolean)
*/
- protected void queueEvent(Event event, boolean front) {
+ @Override
+ protected void queueEvent(Event event, boolean front) {
// Override to snure that queues by this handler are serialized
synchronized(queueLock) {
Job job = getEventHandlerJob();
@@ -482,14 +488,14 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
* entry was already cached or the resource has no history.
*/
private Map getFetchesByProject() {
- Map result = new HashMap();
+ Map<IProject, SyncInfoSet> result = new HashMap<>();
for (Iterator iter = fetches.iterator(); iter.hasNext();) {
FetchRequest request = (FetchRequest) iter.next();
SyncInfo[] infos = request.getInfos();
for (int i = 0; i < infos.length; i++) {
SyncInfo info = infos[i];
IProject project = info.getLocal().getProject();
- SyncInfoSet infoSet = (SyncInfoSet)result.get(project);
+ SyncInfoSet infoSet = result.get(project);
if (infoSet == null) {
infoSet = new SyncInfoSet();
result.put(project, infoSet);
@@ -580,11 +586,11 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
* workspace. The map is CVSTag->SyncInfoSet
*/
private Map getLocalTagMap(SyncInfoSet set) {
- Map result = new HashMap();
+ Map<CVSTag, SyncInfoSet> result = new HashMap<>();
for (Iterator iter = set.iterator(); iter.hasNext();) {
SyncInfo info = (SyncInfo) iter.next();
CVSTag tag = getLocalTag(info);
- SyncInfoSet tagSet = (SyncInfoSet)result.get(tag);
+ SyncInfoSet tagSet = result.get(tag);
if (tagSet == null) {
tagSet = new SyncInfoSet();
result.put(tag, tagSet);
@@ -637,7 +643,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
}
private Map getRootToInfoMap(CVSCompareSubscriber compareSubscriber, SyncInfoSet set) {
- Map rootToInfosMap = new HashMap();
+ Map<IResource, SyncInfoSet> rootToInfosMap = new HashMap<>();
IResource[] roots = compareSubscriber.roots();
for (Iterator iter = set.iterator(); iter.hasNext();) {
SyncInfo info = (SyncInfo) iter.next();
@@ -645,7 +651,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
for (int j = 0; j < roots.length; j++) {
IResource resource = roots[j];
if (resource.getFullPath().isPrefixOf(localPath)) {
- SyncInfoSet infoList = (SyncInfoSet)rootToInfosMap.get(resource);
+ SyncInfoSet infoList = rootToInfosMap.get(resource);
if (infoList == null) {
infoList = new SyncInfoSet();
rootToInfosMap.put(resource, infoList);
@@ -669,7 +675,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
}
private ICVSRemoteResource[] getRemotesToFetch(SyncInfo[] infos) {
- List remotes = new ArrayList();
+ List<ICVSRemoteResource> remotes = new ArrayList<>();
for (int i = 0; i < infos.length; i++) {
SyncInfo info = infos[i];
if (isFetchRequired(info)) {
@@ -679,7 +685,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
}
}
}
- return (ICVSRemoteResource[]) remotes.toArray(new ICVSRemoteResource[remotes.size()]);
+ return remotes.toArray(new ICVSRemoteResource[remotes.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
index 152fa3c79..8879c47f5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
@@ -13,9 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -57,6 +55,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
*/
public class MergeParticipantActionContribution extends SynchronizePageActionGroup {
private MergeUpdateAction updateAction;
+ @Override
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
@@ -104,6 +103,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.SubscriberParticipant#setSubscriber(org.eclipse.team.core.subscribers.TeamSubscriber)
*/
+ @Override
public void setSubscriber(Subscriber subscriber) {
super.setSubscriber(subscriber);
try {
@@ -119,6 +119,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#init(org.eclipse.ui.IMemento)
*/
+ @Override
public void init(String secondayId, IMemento memento) throws PartInitException {
super.init(secondayId, memento);
if(memento != null) {
@@ -139,6 +140,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#init(org.eclipse.ui.IMemento)
*/
+ @Override
public void saveState(IMemento memento) {
super.saveState(memento);
CVSMergeSubscriber s = (CVSMergeSubscriber)getSubscriber();
@@ -148,6 +150,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.AbstractSynchronizeParticipant#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
if(TeamUI.getSynchronizeManager().get(getId(), getSecondaryId()) == null) {
@@ -160,6 +163,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#getName()
*/
+ @Override
public String getName() {
return NLS.bind(CVSUIMessages.CompareParticipant_0, new String[] { ((CVSMergeSubscriber)getSubscriber()).getName(), Utils.convertSelection(getSubscriber().roots()) });
}
@@ -230,7 +234,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
throw new CVSException(NLS.bind(CVSUIMessages.MergeSynchronizeParticipant_10, new String[] { id.toString() }));
}
- List resources = new ArrayList();
+ List<IResource> resources = new ArrayList<>();
for (int i = 0; i < rootNodes.length; i++) {
IMemento rootNode = rootNodes[i];
IPath path = new Path(rootNode.getString(CTX_ROOT_PATH));
@@ -245,7 +249,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
if(resources.isEmpty()) {
throw new CVSException(NLS.bind(CVSUIMessages.MergeSynchronizeParticipant_12, new String[] { id.toString() }));
}
- IResource[] roots = (IResource[]) resources.toArray(new IResource[resources.size()]);
+ IResource[] roots = resources.toArray(new IResource[resources.size()]);
return new CVSMergeSubscriber(id, roots, start, end);
}
@@ -256,6 +260,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.subscribers.SubscriberParticipant#initializeConfiguration(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration)
*/
+ @Override
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, TOOLBAR_CONTRIBUTION_GROUP);
@@ -273,6 +278,7 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SubscriberParticipant#getLongTaskName()
*/
+ @Override
protected String getLongTaskName() {
return getName();
}
@@ -280,11 +286,13 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SubscriberParticipant#getShortTaskName()
*/
+ @Override
protected String getShortTaskName() {
return CVSUIMessages.Participant_merging;
}
- protected CVSChangeSetCapability createChangeSetCapability() {
+ @Override
+ protected CVSChangeSetCapability createChangeSetCapability() {
// See bug 84561 for a description of the problems with Merge Change Sets
return null;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java
index d5cbcb5dc..e2775510d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java
@@ -25,10 +25,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
-import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
@@ -50,6 +47,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberAction#getJobName(org.eclipse.team.ui.sync.SyncInfoSet)
*/
+ @Override
protected String getJobName() {
SyncInfoSet syncSet = getSyncInfoSet();
return NLS.bind(CVSUIMessages.MergeUpdateAction_jobName, new String[] { Integer.valueOf(syncSet.size()).toString() });
@@ -58,6 +56,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateOperation#getOverwriteLocalChanges()
*/
+ @Override
protected boolean getOverwriteLocalChanges() {
return true;
}
@@ -65,6 +64,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateOperation#updated(org.eclipse.core.resources.IResource[])
*/
+ @Override
protected void updated(IResource[] resources) throws TeamException {
// Mark all succesfully updated resources as merged
if(resources.length > 0 && currentSubcriber != null) {
@@ -75,6 +75,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateOperation#runUpdateDeletions(org.eclipse.team.core.synchronize.SyncInfo[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void runUpdateDeletions(SyncInfo[] nodes, IProgressMonitor monitor) throws TeamException {
// When merging, update deletions become outgoing deletions so just delete
// the files locally without unmanaging (so the sync info is kept to
@@ -97,6 +98,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateOperation#runSafeUpdate(org.eclipse.team.core.synchronize.SyncInfo[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void runSafeUpdate(IProject project, SyncInfo[] nodes, IProgressMonitor monitor) throws TeamException {
if(nodes.length > 0) {
setSubscriber(nodes[0]);
@@ -104,8 +106,8 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
CVSTag endTag = ((CVSMergeSubscriber)currentSubcriber).getEndTag();
// Incoming additions require different handling then incoming changes and deletions
- List additions = new ArrayList();
- List changes = new ArrayList();
+ List<SyncInfo> additions = new ArrayList<>();
+ List<SyncInfo> changes = new ArrayList<>();
for (int i = 0; i < nodes.length; i++) {
SyncInfo resource = nodes[i];
int kind = resource.getKind();
@@ -121,7 +123,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
if (!additions.isEmpty()) {
safeUpdate(
project,
- getIResourcesFrom((SyncInfo[]) additions.toArray(new SyncInfo[additions.size()])),
+ getIResourcesFrom(additions.toArray(new SyncInfo[additions.size()])),
new Command.LocalOption[] {
Command.DO_NOT_RECURSE,
Command.makeArgumentOption(Update.JOIN, endTag.getName())
@@ -131,7 +133,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
if (!changes.isEmpty()) {
safeUpdate(
project,
- getIResourcesFrom((SyncInfo[]) changes.toArray(new SyncInfo[changes.size()])),
+ getIResourcesFrom(changes.toArray(new SyncInfo[changes.size()])),
new Command.LocalOption[] {
Command.DO_NOT_RECURSE,
Command.makeArgumentOption(Update.JOIN, startTag.getName()),
@@ -160,6 +162,7 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateOperation#overwriteUpdate(org.eclipse.team.core.synchronize.SyncInfoSet, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void overwriteUpdate(SyncInfoSet set, IProgressMonitor monitor) throws TeamException {
SyncInfo[] nodes = set.getSyncInfos();
if (nodes.length == 0) return;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java
index 2d2f93b72..fc03874e4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java
@@ -23,9 +23,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
-import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
+import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -39,6 +37,7 @@ public class OverrideAndUpdateSubscriberOperation extends CVSSubscriberOperation
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#shouldRun()
*/
+ @Override
public boolean shouldRun() {
SyncInfoSet syncSet = getSyncInfoSet();
return(promptForOverwrite(syncSet));
@@ -46,15 +45,16 @@ public class OverrideAndUpdateSubscriberOperation extends CVSSubscriberOperation
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberOperation#run(org.eclipse.team.core.synchronize.SyncInfoSet, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void runWithProjectRule(IProject project, SyncInfoSet set, IProgressMonitor monitor) throws TeamException {
try {
SyncInfo[] conflicts = set.getNodes(getConflictingAdditionFilter());
- List conflictingResources = new ArrayList();
+ List<IResource> conflictingResources = new ArrayList<>();
for (int i = 0; i < conflicts.length; i++) {
SyncInfo info = conflicts[i];
conflictingResources.add(info.getLocal());
}
- new OverrideAndUpdateOperation(getPart(), project, set.getResources(), (IResource[]) conflictingResources.toArray(new IResource[conflictingResources.size()]), null /* tag */, false /* recurse */).run(monitor);
+ new OverrideAndUpdateOperation(getPart(), project, set.getResources(), conflictingResources.toArray(new IResource[conflictingResources.size()]), null /* tag */, false /* recurse */).run(monitor);
} catch (InvocationTargetException e) {
throw CVSException.wrapException(e);
} catch (InterruptedException e) {
@@ -72,6 +72,7 @@ public class OverrideAndUpdateSubscriberOperation extends CVSSubscriberOperation
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberAction#getJobName(org.eclipse.team.ui.sync.SyncInfoSet)
*/
+ @Override
protected String getJobName() {
SyncInfoSet syncSet = getSyncInfoSet();
return NLS.bind(CVSUIMessages.UpdateAction_jobName, new String[] { Integer.valueOf(syncSet.size()).toString() });
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java
index 3d8af0505..4929e4bac 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java
@@ -80,13 +80,13 @@ public class RefreshDirtyStateOperation extends CVSSubscriberOperation {
}
private void ensureBaseContentsCached(IProject project, SyncInfo[] infos, IProgressMonitor monitor) throws CVSException {
- List diffs = new ArrayList();
+ List<IDiff> diffs = new ArrayList<>();
for (int i = 0; i < infos.length; i++) {
SyncInfo info = infos[i];
IDiff node = getConverter().getDeltaFor(info);
diffs.add(node);
}
- ensureBaseContentsCached(project, (IDiff[]) diffs.toArray(new IDiff[diffs.size()]), monitor);
+ ensureBaseContentsCached(project, diffs.toArray(new IDiff[diffs.size()]), monitor);
}
private SyncInfoToDiffConverter getConverter() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java
index cbd3a35d7..f530db496 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java
@@ -221,13 +221,13 @@ public abstract class SafeUpdateOperation extends CVSSubscriberOperation {
if (changed.length == 0) return;
// The list of sync resources to be updated using "cvs update"
- List updateShallow = new ArrayList();
+ List<SyncInfo> updateShallow = new ArrayList<>();
// A list of sync resource folders which need to be created locally
// (incoming addition or previously pruned)
- Set parentCreationElements = new HashSet();
+ Set<SyncInfo> parentCreationElements = new HashSet<>();
// A list of sync resources that are incoming deletions.
// We do these first to avoid case conflicts
- List updateDeletions = new ArrayList();
+ List<SyncInfo> updateDeletions = new ArrayList<>();
for (int i = 0; i < changed.length; i++) {
SyncInfo changedNode = changed[i];
@@ -288,13 +288,13 @@ public abstract class SafeUpdateOperation extends CVSSubscriberOperation {
monitor.beginTask(null, 100);
if (updateDeletions.size() > 0) {
- runUpdateDeletions((SyncInfo[])updateDeletions.toArray(new SyncInfo[updateDeletions.size()]), Policy.subMonitorFor(monitor, 25));
+ runUpdateDeletions(updateDeletions.toArray(new SyncInfo[updateDeletions.size()]), Policy.subMonitorFor(monitor, 25));
}
if (parentCreationElements.size() > 0) {
- makeInSync((SyncInfo[]) parentCreationElements.toArray(new SyncInfo[parentCreationElements.size()]), Policy.subMonitorFor(monitor, 25));
+ makeInSync(parentCreationElements.toArray(new SyncInfo[parentCreationElements.size()]), Policy.subMonitorFor(monitor, 25));
}
if (updateShallow.size() > 0) {
- runSafeUpdate(project, (SyncInfo[])updateShallow.toArray(new SyncInfo[updateShallow.size()]), Policy.subMonitorFor(monitor, 50));
+ runSafeUpdate(project, updateShallow.toArray(new SyncInfo[updateShallow.size()]), Policy.subMonitorFor(monitor, 50));
}
} finally {
monitor.done();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
index b178d6ae1..e2849dd9c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
@@ -140,13 +140,13 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
if (changed.length == 0) return;
// A list of files to be committed
- final List commits = new ArrayList(); // of IResource
+ final List<IResource> commits = new ArrayList<>();
// New resources that are not yet under CVS control and need a "cvs add"
- final List additions = new ArrayList(); // of IResource
+ final List<IResource> additions = new ArrayList<>();
// A list of incoming or conflicting file changes to be made outgoing changes
- final List makeOutgoing = new ArrayList(); // of SyncInfo
+ final List<SyncInfo> makeOutgoing = new ArrayList<>();
// A list of out-of-sync folders that must be made in-sync
- final List makeInSync = new ArrayList(); // of SyncInfo
+ final List<SyncInfo> makeInSync = new ArrayList<>();
for (int i = 0; i < changed.length; i++) {
SyncInfo changedNode = changed[i];
@@ -206,17 +206,17 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
monitor.beginTask(null, 200);
if (makeInSync.size() > 0) {
- makeInSync((SyncInfo[]) makeInSync.toArray(new SyncInfo[makeInSync.size()]), Policy.subMonitorFor(monitor, 25));
+ makeInSync(makeInSync.toArray(new SyncInfo[makeInSync.size()]), Policy.subMonitorFor(monitor, 25));
}
if (makeOutgoing.size() > 0) {
- makeOutgoing((SyncInfo[]) makeOutgoing.toArray(new SyncInfo[makeInSync.size()]), Policy.subMonitorFor(monitor, 25));
+ makeOutgoing(makeOutgoing.toArray(new SyncInfo[makeInSync.size()]), Policy.subMonitorFor(monitor, 25));
}
if (additions.size() != 0) {
- add(project, (IResource[])additions.toArray(new IResource[0]), Policy.subMonitorFor(monitor, 50));
+ add(project, additions.toArray(new IResource[0]), Policy.subMonitorFor(monitor, 50));
}
- commit(project, (IResource[])commits.toArray(new IResource[commits.size()]), Policy.subMonitorFor(monitor, 100));
+ commit(project, commits.toArray(new IResource[commits.size()]), Policy.subMonitorFor(monitor, 100));
}
private void commit(final IProject project, IResource[] commits, IProgressMonitor monitor) throws TeamException {
@@ -335,7 +335,7 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
// remove unshared resources that were not selected by the user
if (unadded != null && unadded.length > 0) {
- List resourcesToRemove = new ArrayList(unadded.length);
+ List<IResource> resourcesToRemove = new ArrayList<>(unadded.length);
for (int i = 0; i < unadded.length; i++) {
IResource unaddedResource = unadded[i];
boolean included = false;
@@ -349,7 +349,7 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
if (!included)
resourcesToRemove.add(unaddedResource);
}
- syncSet.removeAll((IResource[]) resourcesToRemove.toArray(new IResource[resourcesToRemove.size()]));
+ syncSet.removeAll(resourcesToRemove.toArray(new IResource[resourcesToRemove.size()]));
}
return true;
}
@@ -358,14 +358,14 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
// TODO: Should only get outgoing additions (since conflicting additions
// could be considered to be under version control already)
IResource[] resources = syncSet.getResources();
- List result = new ArrayList();
+ List<IResource> result = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
if (!isAdded(resource)) {
result.add(resource);
}
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
private boolean isAdded(IResource resource) throws CVSException {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index 8a6192796..70fccda94 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -20,7 +20,7 @@ import java.util.Set;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.preferences.*;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.jface.preference.PreferencePage;
@@ -64,6 +64,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
private WorkspaceCommitAction commitToolbar;
private WorkspaceUpdateAction updateToolbar;
+ @Override
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
@@ -147,7 +148,8 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ChangeSetCapability#createChangeSet(org.eclipse.team.core.synchronize.SyncInfo[])
*/
- public ActiveChangeSet createChangeSet(ISynchronizePageConfiguration configuration, IDiff[] infos) {
+ @Override
+ public ActiveChangeSet createChangeSet(ISynchronizePageConfiguration configuration, IDiff[] infos) {
ActiveChangeSet set = getActiveChangeSetManager().createSet(CVSUIMessages.WorkspaceChangeSetCapability_1, new IDiff[0]);
CommitSetDialog dialog = new CommitSetDialog(configuration.getSite().getShell(), set, getResources(infos), CommitSetDialog.NEW);
dialog.open();
@@ -157,20 +159,21 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
}
private IResource[] getResources(IDiff[] diffs) {
- Set result = new HashSet();
+ Set<IResource> result = new HashSet<>();
for (int i = 0; i < diffs.length; i++) {
IDiff diff = diffs[i];
IResource resource = ResourceDiffTree.getResourceFor(diff);
if (resource != null)
result.add(resource);
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ChangeSetCapability#editChangeSet(org.eclipse.team.core.subscribers.ActiveChangeSet)
*/
- public void editChangeSet(ISynchronizePageConfiguration configuration, ActiveChangeSet set) {
+ @Override
+ public void editChangeSet(ISynchronizePageConfiguration configuration, ActiveChangeSet set) {
CommitSetDialog dialog = new CommitSetDialog(configuration.getSite().getShell(), set, set.getResources(), CommitSetDialog.EDIT);
dialog.open();
if (dialog.getReturnCode() != Window.OK) return;
@@ -180,7 +183,8 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ChangeSetCapability#getActiveChangeSetManager()
*/
- public ActiveChangeSetManager getActiveChangeSetManager() {
+ @Override
+ public ActiveChangeSetManager getActiveChangeSetManager() {
return CVSUIPlugin.getPlugin().getChangeSetManager();
}
}
@@ -208,6 +212,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
private SyncInfoFilter contentComparison = new SyncInfoFilter() {
private SyncInfoFilter contentCompare = new SyncInfoFilter.ContentComparisonSyncInfoFilter();
+ @Override
public boolean select(SyncInfo info, IProgressMonitor monitor) {
IResource local = info.getLocal();
// don't select folders
@@ -221,6 +226,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
final SyncInfoFilter regexFilter = createRegexFilter();
if (isConsiderContents() && regexFilter != null) {
return new SyncInfoFilter() {
+ @Override
public boolean select(SyncInfo info, IProgressMonitor monitor) {
return contentComparison.select(info, monitor)
&& !regexFilter.select(info, monitor);
@@ -228,12 +234,14 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
};
} else if (isConsiderContents()) {
return new SyncInfoFilter() {
+ @Override
public boolean select(SyncInfo info, IProgressMonitor monitor) {
return contentComparison.select(info, monitor);
}
};
} else if (regexFilter != null) {
return new SyncInfoFilter() {
+ @Override
public boolean select(SyncInfo info, IProgressMonitor monitor) {
// want to select infos which contain at least one unmatched difference
return !regexFilter.select(info, monitor);
@@ -256,6 +264,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#init(org.eclipse.ui.IMemento)
*/
+ @Override
public void init(String secondaryId, IMemento memento) throws PartInitException {
super.init(secondaryId, memento);
setSubscriber(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber());
@@ -264,6 +273,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.subscribers.SubscriberParticipant#initializeConfiguration(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration)
*/
+ @Override
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
ILabelDecorator labelDecorator = getLabelDecorator(configuration);
@@ -293,6 +303,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
return new CVSParticipantLabelDecorator(configuration);
}
+ @Override
protected ISynchronizeParticipantDescriptor getDescriptor() {
return TeamUI.getSynchronizeManager().getParticipantDescriptor(ID);
}
@@ -300,7 +311,8 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SubscriberParticipant#updateLabels(org.eclipse.team.ui.synchronize.ISynchronizeModelElement, org.eclipse.compare.CompareConfiguration, org.eclipse.core.runtime.IProgressMonitor)
*/
- public void prepareCompareInput(ISynchronizeModelElement element, CompareConfiguration config, IProgressMonitor monitor) throws TeamException {
+ @Override
+ public void prepareCompareInput(ISynchronizeModelElement element, CompareConfiguration config, IProgressMonitor monitor) throws TeamException {
monitor.beginTask(null, 100);
CVSParticipant.deriveBaseContentsFromLocal(element, Policy.subMonitorFor(monitor, 10));
super.prepareCompareInput(element, config, Policy.subMonitorFor(monitor, 80));
@@ -311,14 +323,16 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant#getPreferencePages()
*/
- public PreferencePage[] getPreferencePages() {
+ @Override
+ public PreferencePage[] getPreferencePages() {
return CVSParticipant.addCVSPreferencePages(super.getPreferencePages());
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant#getChangeSetCapability()
*/
- public ChangeSetCapability getChangeSetCapability() {
+ @Override
+ public ChangeSetCapability getChangeSetCapability() {
if (capability == null) {
capability = new WorkspaceChangeSetCapability();
}
@@ -328,7 +342,8 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant#isViewerContributionsSupported()
*/
- protected boolean isViewerContributionsSupported() {
+ @Override
+ protected boolean isViewerContributionsSupported() {
return true;
}
@@ -336,6 +351,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
refresh(resources, getShortTaskName(), getLongTaskName(resources), site);
}
+ @Override
public void dispose() {
super.dispose();
((IEclipsePreferences) CVSUIPlugin.getPlugin().getInstancePreferences().node("")).removePreferenceChangeListener(this); //$NON-NLS-1$
@@ -344,6 +360,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
/* (non-Javadoc)
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
*/
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
if (event.getKey().equals(ICVSUIConstants.PREF_CONSIDER_CONTENTS) || event.getKey().equals(ICVSUIConstants.PREF_SYNCVIEW_REGEX_FILTER_PATTERN)) {
SyncInfoFilter filter = createSyncInfoFilter();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/FilteredTagList.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/FilteredTagList.java
index d17ba6af3..0e77c233a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/FilteredTagList.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/FilteredTagList.java
@@ -39,9 +39,10 @@ public class FilteredTagList implements IWorkbenchAdapter, IAdaptable {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
*/
- public Object[] getChildren(Object o) {
+ @Override
+ public Object[] getChildren(Object o) {
CVSTag[] tags = getTags();
- List filtered = new ArrayList();
+ List<TagElement> filtered = new ArrayList<>();
for (int i = 0; i < tags.length; i++) {
CVSTag tag = tags[i];
if (select(tag)) {
@@ -63,28 +64,32 @@ public class FilteredTagList implements IWorkbenchAdapter, IAdaptable {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
- public ImageDescriptor getImageDescriptor(Object object) {
+ @Override
+ public ImageDescriptor getImageDescriptor(Object object) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
- public String getLabel(Object o) {
+ @Override
+ public String getLabel(Object o) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
*/
- public Object getParent(Object o) {
+ @Override
+ public Object getParent(Object o) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- public <T> T getAdapter(Class<T> adapter) {
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
if (adapter == IWorkbenchAdapter.class) return adapter.cast(this);
return null;
}
@@ -98,14 +103,14 @@ public class FilteredTagList implements IWorkbenchAdapter, IAdaptable {
public CVSTag[] getMatchingTags() {
CVSTag[] tags = getTags();
- List filtered = new ArrayList();
+ List<CVSTag> filtered = new ArrayList<>();
for (int i = 0; i < tags.length; i++) {
CVSTag tag = tags[i];
if (select(tag)) {
filtered.add(tag);
}
}
- return (CVSTag[])filtered.toArray(new CVSTag[filtered.size()]);
+ return filtered.toArray(new CVSTag[filtered.size()]);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/LocalProjectTagSource.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/LocalProjectTagSource.java
index 531d8b60a..910cbadd9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/LocalProjectTagSource.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/LocalProjectTagSource.java
@@ -13,11 +13,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.tags;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -64,7 +60,7 @@ public class LocalProjectTagSource extends TagSource {
*/
private static ICVSRemoteFolder[] getProjectRemoteFolders() {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- List result = new ArrayList();
+ List<ICVSRemoteFolder> result = new ArrayList<>();
for (int i = 0; i < projects.length; i++) {
IProject project = projects[i];
try {
@@ -79,13 +75,14 @@ public class LocalProjectTagSource extends TagSource {
CVSUIPlugin.log(e);
}
}
- return (ICVSRemoteFolder[]) result.toArray(new ICVSRemoteFolder[result.size()]);
+ return result.toArray(new ICVSRemoteFolder[result.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#refresh(boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
- public CVSTag[] refresh(boolean bestEffort, IProgressMonitor monitor) throws TeamException {
+ @Override
+ public CVSTag[] refresh(boolean bestEffort, IProgressMonitor monitor) throws TeamException {
// This tag source should not be refreshed
return new CVSTag[0];
}
@@ -93,40 +90,45 @@ public class LocalProjectTagSource extends TagSource {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getLocation()
*/
- public ICVSRepositoryLocation getLocation() {
+ @Override
+ public ICVSRepositoryLocation getLocation() {
return seedFolder.getRepository();
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getShortDescription()
*/
- public String getShortDescription() {
+ @Override
+ public String getShortDescription() {
return NLS.bind(CVSUIMessages.LocalProjectTagSource_0, new String[] { Integer.toString(remoteFolders.length) });
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#commit(org.eclipse.team.internal.ccvs.core.CVSTag[], boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
- public void commit(CVSTag[] tags, boolean replace, IProgressMonitor monitor) throws CVSException {
+ @Override
+ public void commit(CVSTag[] tags, boolean replace, IProgressMonitor monitor) throws CVSException {
// Does not commit tags
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getCVSResources()
*/
- public ICVSResource[] getCVSResources() {
+ @Override
+ public ICVSResource[] getCVSResources() {
return remoteFolders;
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getTags(int)
*/
- public CVSTag[] getTags(int type) {
+ @Override
+ public CVSTag[] getTags(int type) {
if (type == CVSTag.HEAD || type == BASE) {
return super.getTags(type);
}
// Accumulate the tags for all folders
- Set allTags = new HashSet();
+ Set<CVSTag> allTags = new HashSet<>();
for (int i = 0; i < remoteFolders.length; i++) {
ICVSRemoteFolder folder = remoteFolders[i];
CVSTag[] tags = SingleFolderTagSource.getTags(folder, type);
@@ -135,7 +137,7 @@ public class LocalProjectTagSource extends TagSource {
// Exclude the tags for the seedFolder
CVSTag[] tags = SingleFolderTagSource.getTags(seedFolder, type);
allTags.removeAll(Arrays.asList(tags));
- return (CVSTag[]) allTags.toArray(new CVSTag[allTags.size()]);
+ return allTags.toArray(new CVSTag[allTags.size()]);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/MultiFolderTagSource.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/MultiFolderTagSource.java
index e2960f94a..8fd781195 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/MultiFolderTagSource.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/MultiFolderTagSource.java
@@ -55,11 +55,11 @@ public class MultiFolderTagSource extends SingleFolderTagSource {
if (type == CVSTag.HEAD || type == BASE) {
return super.getTags(type);
}
- Set tags= new HashSet();
+ Set<CVSTag> tags = new HashSet<>();
for (int i= 0; i < folders.length; i++) {
tags.addAll(Arrays.asList(getTags(folders[i], type)));
}
- return (CVSTag[]) tags.toArray(new CVSTag[tags.size()]);
+ return tags.toArray(new CVSTag[tags.size()]);
}
/* (non-Javadoc)
@@ -68,7 +68,7 @@ public class MultiFolderTagSource extends SingleFolderTagSource {
@Override
public CVSTag[] refresh(boolean bestEffort, IProgressMonitor monitor) throws TeamException {
monitor.beginTask("", folders.length); //$NON-NLS-1$
- Set result= new HashSet();
+ Set<CVSTag> result = new HashSet<>();
for (int i= 0; i < folders.length; i++) {
ICVSFolder folder= folders[i];
CVSTag[] tags = CVSUIPlugin.getPlugin().getRepositoryManager().refreshDefinedTags(folder, bestEffort /* recurse */, true /* notify */, Policy.subMonitorFor(monitor, 1));
@@ -76,7 +76,7 @@ public class MultiFolderTagSource extends SingleFolderTagSource {
}
monitor.done();
fireChange();
- return (CVSTag[]) result.toArray(new CVSTag[result.size()]);
+ return result.toArray(new CVSTag[result.size()]);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/SingleFileTagSource.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/SingleFileTagSource.java
index 709cbcfce..f1f806a0b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/SingleFileTagSource.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/SingleFileTagSource.java
@@ -28,7 +28,7 @@ import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
public class SingleFileTagSource extends TagSource {
public static CVSTag[] fetchTagsFor(ICVSFile file, IProgressMonitor monitor) throws TeamException {
- Set tagSet = new HashSet();
+ Set<CVSTag> tagSet = new HashSet<>();
ILogEntry[] entries = file.getLogEntries(monitor);
for (int j = 0; j < entries.length; j++) {
CVSTag[] tags = entries[j].getTags();
@@ -36,7 +36,7 @@ public class SingleFileTagSource extends TagSource {
tagSet.add(tags[k]);
}
}
- return (CVSTag[])tagSet.toArray(new CVSTag[tagSet.size()]);
+ return tagSet.toArray(new CVSTag[tagSet.size()]);
}
private ICVSFile file;
@@ -53,14 +53,16 @@ public class SingleFileTagSource extends TagSource {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getTags(int)
*/
- public CVSTag[] getTags(int type) {
+ @Override
+ public CVSTag[] getTags(int type) {
return parentFolderTagSource.getTags(type);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#refresh(org.eclipse.core.runtime.IProgressMonitor)
*/
- public CVSTag[] refresh(boolean bestEffort, IProgressMonitor monitor) throws TeamException {
+ @Override
+ public CVSTag[] refresh(boolean bestEffort, IProgressMonitor monitor) throws TeamException {
CVSTag[] tags = fetchTagsFor(file, monitor);
commit(tags, false, monitor);
fireChange();
@@ -70,7 +72,8 @@ public class SingleFileTagSource extends TagSource {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getLocation()
*/
- public ICVSRepositoryLocation getLocation() {
+ @Override
+ public ICVSRepositoryLocation getLocation() {
RepositoryManager mgr = CVSUIPlugin.getPlugin().getRepositoryManager();
ICVSRepositoryLocation location = mgr.getRepositoryLocationFor(file);
return location;
@@ -79,14 +82,16 @@ public class SingleFileTagSource extends TagSource {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getShortDescription()
*/
- public String getShortDescription() {
+ @Override
+ public String getShortDescription() {
return file.getName();
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#commit(org.eclipse.team.internal.ccvs.core.CVSTag[], boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
- public void commit(CVSTag[] tags, boolean replace, IProgressMonitor monitor) throws CVSException {
+ @Override
+ public void commit(CVSTag[] tags, boolean replace, IProgressMonitor monitor) throws CVSException {
parentFolderTagSource.commit(tags, replace, monitor);
fireChange();
}
@@ -94,7 +99,8 @@ public class SingleFileTagSource extends TagSource {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.tags.TagSource#getCVSResources()
*/
- public ICVSResource[] getCVSResources() {
+ @Override
+ public ICVSResource[] getCVSResources() {
return new ICVSResource[] { file };
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagConfigurationDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagConfigurationDialog.java
index d0e610561..cf74e7e98 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagConfigurationDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagConfigurationDialog.java
@@ -104,9 +104,9 @@ public class TagConfigurationDialog extends TrayDialog {
class TagSourceWrapper extends TagSource {
private final TagSource tagSource;
- private final List branches = new ArrayList();
- private final List versions = new ArrayList();
- private final List dates = new ArrayList();
+ private final List<CVSTag> branches = new ArrayList<>();
+ private final List<CVSTag> versions = new ArrayList<>();
+ private final List<CVSTag> dates = new ArrayList<>();
public TagSourceWrapper(TagSource tagSource) {
this.tagSource = tagSource;
@@ -120,13 +120,13 @@ public class TagConfigurationDialog extends TrayDialog {
if (type == CVSTag.HEAD || type == BASE) {
return super.getTags(type);
}
- List list = getTagList(type);
+ List<CVSTag> list = getTagList(type);
if (list != null)
- return (CVSTag[]) list.toArray(new CVSTag[list.size()]);
+ return list.toArray(new CVSTag[list.size()]);
return tagSource.getTags(type);
}
- private List getTagList(int type) {
+ private List<CVSTag> getTagList(int type) {
switch (type) {
case CVSTag.VERSION:
return versions;
@@ -166,7 +166,7 @@ public class TagConfigurationDialog extends TrayDialog {
public void add(CVSTag[] tags) {
for (int i = 0; i < tags.length; i++) {
CVSTag tag = tags[i];
- List list = getTagList(tag.getType());
+ List<CVSTag> list = getTagList(tag.getType());
if (list != null)
list.add(tag);
}
@@ -484,7 +484,7 @@ public class TagConfigurationDialog extends TrayDialog {
private void updateShownTags() {
final CVSFileElement[] filesSelection = getSelectedFiles();
- final Set tags = new HashSet();
+ final Set<CVSTag> tags = new HashSet<>();
if(filesSelection.length!=0) {
try {
CVSUIPlugin.runWithProgress(getShell(), true /*cancelable*/, monitor -> {
@@ -508,7 +508,7 @@ public class TagConfigurationDialog extends TrayDialog {
cvsTagTree.getTable().removeAll();
for (Iterator it = tags.iterator(); it.hasNext();) {
CVSTag tag = (CVSTag) it.next();
- List knownTags = new ArrayList();
+ List<CVSTag> knownTags = new ArrayList<>();
knownTags.addAll(Arrays.asList(wrappedTagSource.getTags(new int[] { CVSTag.VERSION, CVSTag.BRANCH, CVSTag.DATE })));
if(!knownTags.contains(tag)) {
TagElement tagElem = new TagElement(tag);
@@ -522,15 +522,15 @@ public class TagConfigurationDialog extends TrayDialog {
private CVSFileElement[] getSelectedFiles() {
IStructuredSelection selection = cvsResourceTree.getStructuredSelection();
if (!selection.isEmpty()) {
- final List filesSelection = new ArrayList();
+ final List<CVSFileElement> filesSelection = new ArrayList<>();
Iterator it = selection.iterator();
while(it.hasNext()) {
Object o = it.next();
if(o instanceof CVSFileElement) {
- filesSelection.add(o);
+ filesSelection.add((CVSFileElement) o);
}
}
- return (CVSFileElement[]) filesSelection.toArray(new CVSFileElement[filesSelection.size()]);
+ return filesSelection.toArray(new CVSFileElement[filesSelection.size()]);
}
return new CVSFileElement[0];
}
@@ -538,12 +538,12 @@ public class TagConfigurationDialog extends TrayDialog {
private void addSelectionToAutoRefreshList() {
IStructuredSelection selection = cvsResourceTree.getStructuredSelection();
if (!selection.isEmpty()) {
- final List filesSelection = new ArrayList();
+ final List<CVSFileElement> filesSelection = new ArrayList<>();
Iterator it = selection.iterator();
while(it.hasNext()) {
Object o = it.next();
if(o instanceof CVSFileElement) {
- filesSelection.add(o);
+ filesSelection.add((CVSFileElement) o);
}
}
if(!filesSelection.isEmpty()) {
@@ -570,20 +570,20 @@ public class TagConfigurationDialog extends TrayDialog {
private void rememberCheckedTags() {
Object[] checked = cvsTagTree.getCheckedElements();
- List tagsToAdd = new ArrayList();
+ List<CVSTag> tagsToAdd = new ArrayList<>();
for (int i = 0; i < checked.length; i++) {
CVSTag tag = ((TagElement)checked[i]).getTag();
tagsToAdd.add(tag);
}
if (!tagsToAdd.isEmpty()) {
- wrappedTagSource.add((CVSTag[]) tagsToAdd.toArray(new CVSTag[tagsToAdd.size()]));
+ wrappedTagSource.add(tagsToAdd.toArray(new CVSTag[tagsToAdd.size()]));
cvsDefinedTagsTree.refresh();
}
}
private void deleteSelected() {
IStructuredSelection selection = cvsDefinedTagsTree.getStructuredSelection();
- List tagsToRemove = new ArrayList();
+ List<CVSTag> tagsToRemove = new ArrayList<>();
if (!selection.isEmpty()) {
Iterator it = selection.iterator();
while(it.hasNext()) {
@@ -595,14 +595,14 @@ public class TagConfigurationDialog extends TrayDialog {
}
}
if (!tagsToRemove.isEmpty()) {
- wrappedTagSource.remove((CVSTag[]) tagsToRemove.toArray(new CVSTag[tagsToRemove.size()]));
+ wrappedTagSource.remove(tagsToRemove.toArray(new CVSTag[tagsToRemove.size()]));
cvsDefinedTagsTree.refresh();
cvsDefinedTagsTree.getTree().setFocus();
}
}
private void addDateTagsSelected(CVSTag tag){
if(tag == null) return;
- List knownTags = new ArrayList();
+ List<CVSTag> knownTags = new ArrayList<>();
knownTags.addAll(Arrays.asList(wrappedTagSource.getTags(CVSTag.DATE)));
if(!knownTags.contains( tag)){
wrappedTagSource.add(new CVSTag[] { tag });
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagContentAssistProcessor.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagContentAssistProcessor.java
index 12ba5165f..a237969b8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagContentAssistProcessor.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagContentAssistProcessor.java
@@ -32,7 +32,7 @@ import org.eclipse.ui.contentassist.ContentAssistHandler;
public class TagContentAssistProcessor implements ISubjectControlContentAssistProcessor {
private FilteredTagList tags;
- private Map images = new HashMap();
+ private Map<ImageDescriptor, Image> images = new HashMap<>();
public static void createContentAssistant(Text text, TagSource tagSource, int includeFlags) {
final TagContentAssistProcessor tagContentAssistProcessor = new TagContentAssistProcessor(tagSource, includeFlags);
@@ -70,14 +70,14 @@ public class TagContentAssistProcessor implements ISubjectControlContentAssistPr
tags.setPattern(filter);
CVSTag[] matching = tags.getMatchingTags();
if (matching.length > 0) {
- List proposals = new ArrayList();
+ List<CompletionProposal> proposals = new ArrayList<>();
for (int i = 0; i < matching.length; i++) {
CVSTag tag = matching[i];
String name = tag.getName();
ImageDescriptor desc = TagElement.getImageDescriptor(tag);
Image image = null;
if (desc != null) {
- image = (Image)images.get(desc);
+ image = images.get(desc);
if (image == null) {
image = desc.createImage();
images.put(desc, image);
@@ -86,7 +86,7 @@ public class TagContentAssistProcessor implements ISubjectControlContentAssistPr
CompletionProposal proposal = new CompletionProposal(name, 0, docLength, name.length(), image, name, null, null);
proposals.add(proposal);
}
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
+ return proposals.toArray(new ICompletionProposal[proposals.size()]);
}
}
return null;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java
index 1b52ef8d9..86882b381 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java
@@ -416,10 +416,10 @@ public class TagSelectionArea extends DialogArea {
* Returns the selected date tag elements
*/
private TagElement[] getSelectedDateTagElement() {
- ArrayList dateTagElements = null;
+ ArrayList<Object> dateTagElements = null;
IStructuredSelection selection = tagTree.getStructuredSelection();
if (selection!=null && !selection.isEmpty()) {
- dateTagElements = new ArrayList();
+ dateTagElements = new ArrayList<>();
Iterator elements = selection.iterator();
while (elements.hasNext()) {
Object next = TeamAction.getAdapter(elements.next(), TagElement.class);
@@ -439,7 +439,7 @@ public class TagSelectionArea extends DialogArea {
}
private void addDateTag(CVSTag tag){
if(tag == null) return;
- List dateTags = new ArrayList();
+ List<CVSTag> dateTags = new ArrayList<>();
ICVSRepositoryLocation location = getLocation();
dateTags.addAll(Arrays.asList(CVSUIPlugin.getPlugin().getRepositoryManager().getDateTags(location)));
if(!dateTags.contains( tag)){
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSource.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSource.java
index 01763c0dc..303cb4be2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSource.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSource.java
@@ -15,6 +15,7 @@ package org.eclipse.team.internal.ccvs.ui.tags;
import java.util.*;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.runtime.*;
@@ -33,28 +34,34 @@ public abstract class TagSource {
public static final int BASE = -1;
public static final TagSource EMPTY = new TagSource() {
- public void commit(CVSTag[] tags, boolean replace, IProgressMonitor monitor) throws CVSException {
+ @Override
+ public void commit(CVSTag[] tags, boolean replace, IProgressMonitor monitor) throws CVSException {
// No-op
}
- public ICVSRepositoryLocation getLocation() {
+ @Override
+ public ICVSRepositoryLocation getLocation() {
// TODO Auto-generated method stub
return null;
}
- public String getShortDescription() {
+ @Override
+ public String getShortDescription() {
return "Empty"; //$NON-NLS-1$
}
- public CVSTag[] getTags(int type) {
+ @Override
+ public CVSTag[] getTags(int type) {
return new CVSTag[0];
}
- public CVSTag[] refresh(boolean bestEffort, IProgressMonitor monitor) throws TeamException {
+ @Override
+ public CVSTag[] refresh(boolean bestEffort, IProgressMonitor monitor) throws TeamException {
return new CVSTag[0];
}
- public ICVSResource[] getCVSResources() {
+ @Override
+ public ICVSResource[] getCVSResources() {
return new ICVSResource[0];
}
};
- private ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
+ private ListenerList<ITagSourceChangeListener> listeners = new ListenerList<>(ListenerList.IDENTITY);
/**
* Simple interface for providing notification when the tags
@@ -65,7 +72,7 @@ public abstract class TagSource {
}
public static int[] convertIncludeFlaqsToTagTypes(int includeFlags) {
- List types = new ArrayList();
+ List<Integer> types = new ArrayList<>();
if ((includeFlags & TagSelectionArea.INCLUDE_BRANCHES) > 0)
types.add(Integer.valueOf(CVSTag.BRANCH));
if ((includeFlags & TagSelectionArea.INCLUDE_VERSIONS) > 0)
@@ -78,7 +85,7 @@ public abstract class TagSource {
types.add(Integer.valueOf(BASE));
int[] result = new int[types.size()];
for (int i = 0; i < result.length; i++) {
- result[i] = ((Integer)types.get(i)).intValue();
+ result[i] = types.get(i).intValue();
}
return result;
@@ -109,11 +116,11 @@ public abstract class TagSource {
}
private static ICVSFolder[] getFolders(ICVSResource[] resources) {
- HashSet result= new HashSet();
+ HashSet<ICVSFolder> result = new HashSet<>();
for (int i= 0; i < resources.length; i++) {
result.add(getFirstFolder(resources[i]));
}
- return (ICVSFolder[]) result.toArray(new ICVSFolder[result.size()]);
+ return result.toArray(new ICVSFolder[result.size()]);
}
/**
@@ -135,21 +142,21 @@ public abstract class TagSource {
}
private static IResource[] getProjects(ResourceMapping[] mappers) {
- Set projects = new HashSet();
+ Set<IProject> projects = new HashSet<>();
for (int i = 0; i < mappers.length; i++) {
ResourceMapping mapper = mappers[i];
projects.addAll(Arrays.asList(mapper.getProjects()));
}
- return (IResource[]) projects.toArray(new IResource[projects.size()]);
+ return projects.toArray(new IResource[projects.size()]);
}
private static IResource[] getProjects(IResource[] resources) {
- Set result = new HashSet();
+ Set<IProject> result = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
result.add(resource.getProject());
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
/**
@@ -162,12 +169,12 @@ public abstract class TagSource {
}
private static ICVSResource[] getCVSResources(IResource[] resources) {
- List cvsResources = new ArrayList();
+ List<ICVSResource> cvsResources = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
cvsResources.add(CVSWorkspaceRoot.getCVSResourceFor(resource));
}
- return (ICVSResource[]) cvsResources.toArray(new ICVSResource[cvsResources.size()]);
+ return cvsResources.toArray(new ICVSResource[cvsResources.size()]);
}
private static ICVSFolder getFirstFolder(ICVSResource resource) {
@@ -195,13 +202,13 @@ public abstract class TagSource {
if (types.length == 1) {
return getTags(types[0]);
}
- List result = new ArrayList();
+ List<CVSTag> result = new ArrayList<>();
for (int i = 0; i < types.length; i++) {
int type = types[i];
CVSTag[] tags = getTags(type);
result.addAll(Arrays.asList(tags));
}
- return (CVSTag[]) result.toArray(new CVSTag[result.size()]);
+ return result.toArray(new CVSTag[result.size()]);
}
/**
@@ -245,10 +252,12 @@ public abstract class TagSource {
for (int i = 0; i < list.length; i++) {
final ITagSourceChangeListener listener = (ITagSourceChangeListener)list[i];
SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
+ @Override
+ public void handleException(Throwable exception) {
// logged by run
}
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
listener.tagsChanged(TagSource.this);
}
});
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java
index 0ea73a7ab..dbdf19a15 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java
@@ -19,6 +19,7 @@ import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.ui.model.CVSResourceElement;
import org.eclipse.ui.model.IWorkbenchAdapter;
/**
@@ -37,10 +38,11 @@ public class TagSourceResourceAdapter implements IAdaptable, IWorkbenchAdapter {
this.tagSource = tagSource;
}
- public Object[] getChildren(Object o) {
+ @Override
+ public Object[] getChildren(Object o) {
ICVSResource[] children = tagSource.getCVSResources();
if (children.length == 0) return new Object[0];
- List result = new ArrayList();
+ List<CVSResourceElement> result = new ArrayList<>();
for (int i = 0; i < children.length; i++) {
ICVSResource resource = children[i];
if (resource.isFolder()) {
@@ -52,21 +54,25 @@ public class TagSourceResourceAdapter implements IAdaptable, IWorkbenchAdapter {
return result.toArray(new Object[result.size()]);
}
- public ImageDescriptor getImageDescriptor(Object object) {
+ @Override
+ public ImageDescriptor getImageDescriptor(Object object) {
// No image descriptor
return null;
}
- public String getLabel(Object o) {
+ @Override
+ public String getLabel(Object o) {
return tagSource.getShortDescription();
}
- public Object getParent(Object o) {
+ @Override
+ public Object getParent(Object o) {
// No parent
return null;
}
- public <T> T getAdapter(Class<T> adapter) {
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
if (adapter == IWorkbenchAdapter.class) {
return adapter.cast(this);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceWorkbenchAdapter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceWorkbenchAdapter.java
index 295a6b6c3..863d291ce 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceWorkbenchAdapter.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceWorkbenchAdapter.java
@@ -17,7 +17,8 @@ import java.util.ArrayList;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.ui.model.IWorkbenchAdapter;
@@ -49,6 +50,7 @@ public class TagSourceWorkbenchAdapter implements IAdaptable, IWorkbenchAdapter
/*
* The order in the diaog should be HEAD, Branches, Versions, Dates, BASE
*/
+ @Override
public int category(Object element) {
if (element instanceof TagElement) {
CVSTag tag = ((TagElement)element).getTag();
@@ -64,6 +66,7 @@ public class TagSourceWorkbenchAdapter implements IAdaptable, IWorkbenchAdapter
}
return 0;
}
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
int cat1 = category(e1);
int cat2 = category(e2);
@@ -112,8 +115,9 @@ public class TagSourceWorkbenchAdapter implements IAdaptable, IWorkbenchAdapter
}
}
+ @Override
public Object[] getChildren(Object o) {
- ArrayList children = new ArrayList(4);
+ ArrayList<IAdaptable> children = new ArrayList<>(4);
if ((includeFlags & INCLUDE_HEAD_TAG) > 0) {
children.add(new TagElement(this, CVSTag.DEFAULT));
}
@@ -131,16 +135,20 @@ public class TagSourceWorkbenchAdapter implements IAdaptable, IWorkbenchAdapter
}
return children.toArray(new Object[children.size()]);
}
+ @Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter == IWorkbenchAdapter.class) return adapter.cast(this);
return null;
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return null;
}
+ @Override
public String getLabel(Object o) {
return null;
}
+ @Override
public Object getParent(Object o) {
return null;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java
index c3eb200b4..7144e81c9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/AddWizard.java
@@ -55,7 +55,7 @@ public class AddWizard extends ResizableWizard {
}
private static IFile[] getUnaddedWithUnknownFileType(final ResourceTraversal[] traversals) throws InvocationTargetException, InterruptedException {
- final List unadded = new ArrayList();
+ final List<IResource> unadded = new ArrayList<>();
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(monitor -> {
final IFileContentManager manager = Team.getFileContentManager();
for (int i = 0; i < traversals.length; i++) {
@@ -90,7 +90,7 @@ public class AddWizard extends ResizableWizard {
}
}
});
- return (IFile[]) unadded.toArray(new IFile[unadded.size()]);
+ return unadded.toArray(new IFile[unadded.size()]);
}
public AddWizard(AddOperation op, IFile[] unknowns) {
@@ -102,10 +102,10 @@ public class AddWizard extends ResizableWizard {
}
@Override
- public void addPages() {
+ public void addPages() {
- final Collection names= new HashSet();
- final Collection extensions= new HashSet();
+ final Collection<String> names= new HashSet<String>();
+ final Collection<String> extensions= new HashSet<String>();
getUnknownNamesAndExtension(unknowns, names, extensions);
if (names.size() + extensions.size() > 0) {
@@ -116,7 +116,7 @@ public class AddWizard extends ResizableWizard {
super.addPages();
}
- private static void getUnknownNamesAndExtension(IFile[] files, Collection names, Collection extensions) {
+ private static void getUnknownNamesAndExtension(IFile[] files, Collection<String> names, Collection<String> extensions) {
final IFileContentManager manager= Team.getFileContentManager();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
index 1b7f06bcb..1a39f85a1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
@@ -249,6 +249,7 @@ public abstract class CVSWizardPage extends WizardPage {
*/
protected ITreeContentProvider getResourceProvider(final int resourceType) {
return new WorkbenchContentProvider() {
+ @Override
public Object[] getChildren(Object o) {
if (o instanceof IContainer) {
IResource[] members = null;
@@ -260,7 +261,7 @@ public abstract class CVSWizardPage extends WizardPage {
}
//filter out the desired resource types
- ArrayList results = new ArrayList();
+ ArrayList<IResource> results = new ArrayList<>();
for (int i = 0; i < members.length; i++) {
//And the test bits with the resource types to see if they are what we want
if ((members[i].getType() & resourceType) > 0) {
@@ -295,6 +296,7 @@ public abstract class CVSWizardPage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#getNextPage()
*/
+ @Override
public IWizardPage getNextPage() {
ICVSWizard w = getCVSWizard();
if (w != null) {
@@ -308,6 +310,7 @@ public abstract class CVSWizardPage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#canFlipToNextPage()
*/
+ @Override
public boolean canFlipToNextPage() {
ICVSWizard w = getCVSWizard();
if (w != null) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java
index 304823685..841381354 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsLocationSelectionPage.java
@@ -231,7 +231,7 @@ public class CheckoutAsLocationSelectionPage extends CVSWizardPage {
* @return the history with the new entry appended
*/
private String[] addToHistory(String[] history, String newEntry) {
- ArrayList l = new ArrayList(Arrays.asList(history));
+ ArrayList<String> l = new ArrayList<>(Arrays.asList(history));
addToHistory(l, newEntry);
String[] r = new String[l.size()];
l.toArray(r);
@@ -246,7 +246,7 @@ public class CheckoutAsLocationSelectionPage extends CVSWizardPage {
* @param history the current history
* @param newEntry the entry to add to the history
*/
- private void addToHistory(List history, String newEntry) {
+ private void addToHistory(List<String> history, String newEntry) {
history.remove(newEntry);
history.add(0,newEntry);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsProjectSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsProjectSelectionPage.java
index b75224bbe..f13bdc6f7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsProjectSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsProjectSelectionPage.java
@@ -196,7 +196,7 @@ public class CheckoutAsProjectSelectionPage extends CVSWizardPage {
* @return IResource
*/
private IProject[] getProjects(String root, boolean unshared) throws CVSException {
- List validTargets = new ArrayList();
+ List<IProject> validTargets = new ArrayList<>();
try {
IResource[] projects = ResourcesPlugin.getWorkspace().getRoot().members();
for (int i = 0; i < projects.length; i++) {
@@ -220,7 +220,7 @@ public class CheckoutAsProjectSelectionPage extends CVSWizardPage {
} catch (CoreException e) {
throw CVSException.wrapException(e);
}
- return (IProject[]) validTargets.toArray(new IProject[validTargets.size()]);
+ return validTargets.toArray(new IProject[validTargets.size()]);
}
public IContainer getLocalFolder() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java
index d0747130f..0d563a010 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java
@@ -339,8 +339,8 @@ public class CommitWizard extends ResizableWizard {
@Override
public void addPages() {
- final Collection names= new HashSet();
- final Collection extensions= new HashSet();
+ final Collection<String> names = new HashSet<>();
+ final Collection<String> extensions = new HashSet<>();
getUnknownNamesAndExtension(fUnaddedDiffs, names, extensions);
if (names.size() + extensions.size() > 0) {
@@ -444,7 +444,8 @@ public class CommitWizard extends ResizableWizard {
return dialog.open();
}
- private void getUnknownNamesAndExtension(IResource[] resources, Collection names, Collection extensions) {
+ private void getUnknownNamesAndExtension(IResource[] resources, Collection<String> names,
+ Collection<String> extensions) {
final IFileContentManager manager= Team.getFileContentManager();
@@ -465,22 +466,22 @@ public class CommitWizard extends ResizableWizard {
}
private IResource[] getUnaddedResources(IResource[] resources) throws CVSException {
- List/*<IResource>*/ unadded = new ArrayList/*<IResource>*/();
+ List/* <IResource> */<IResource> unadded = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
if (!isAdded(resources[i])) {
unadded.add(resources[i]);
}
}
- return (IResource[]) unadded.toArray(new IResource[0]);
+ return unadded.toArray(new IResource[0]);
}
private IResource[] getFiles(IResource[] resources) {
- final List files = new ArrayList();
+ final List<IResource> files = new ArrayList<>();
for (int i = 0; i < resources.length; i++) {
if (resources[i].getType() == IResource.FILE)
files.add(resources[i]);
}
- return (IResource[]) files.toArray(new IResource[0]);
+ return files.toArray(new IResource[0]);
}
private static boolean isAdded(IResource resource) throws CVSException {
@@ -492,7 +493,7 @@ public class CommitWizard extends ResizableWizard {
}
private static IResource[] getDeepResourcesToCommit(ResourceTraversal[] traversals, IProgressMonitor monitor) throws CoreException {
- List roots = new ArrayList();
+ List<IResource> roots = new ArrayList<>();
for (int j = 0; j < traversals.length; j++) {
ResourceTraversal traversal = traversals[j];
IResource[] resources = traversal.getResources();
@@ -510,14 +511,14 @@ public class CommitWizard extends ResizableWizard {
}
}
}
- return (IResource[]) roots.toArray(new IResource[roots.size()]);
+ return roots.toArray(new IResource[roots.size()]);
}
private static IResource[] members(IResource resource) throws CoreException {
return CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber().members(resource);
}
- private static void collectShallowFiles(IResource[] resources, List roots) {
+ private static void collectShallowFiles(IResource[] resources, List<IResource> roots) {
for (int k = 0; k < resources.length; k++) {
IResource resource = resources[k];
if (resource.getType() == IResource.FILE)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardFileTypePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardFileTypePage.java
index 72bf5930a..9b02b25db 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardFileTypePage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardFileTypePage.java
@@ -14,11 +14,7 @@
package org.eclipse.team.internal.ccvs.ui.wizards;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.dialogs.Dialog;
@@ -34,9 +30,11 @@ import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-import org.eclipse.team.internal.ccvs.ui.*;
+import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.team.internal.ui.preferences.FileTypeTable;
+import org.eclipse.team.internal.ui.preferences.FileTypeTable.Item;
import org.eclipse.ui.PlatformUI;
/**
@@ -45,14 +43,14 @@ import org.eclipse.ui.PlatformUI;
public class CommitWizardFileTypePage extends WizardPage {
private final Collection fExtensions;
- private final Collection fNames;
+ private final Collection<Item> fNames;
public CommitWizardFileTypePage(Collection unknownExtensions, Collection unknownNames) {
super(CVSUIMessages.CommitWizardFileTypePage_0);
setTitle(CVSUIMessages.CommitWizardFileTypePage_0);
setDescription(CVSUIMessages.CommitWizardFileTypePage_2);
- fNames= new ArrayList();
+ fNames = new ArrayList<>();
for (final Iterator iter = unknownNames.iterator(); iter.hasNext();) {
final String name = (String) iter.next();
fNames.add(new FileTypeTable.Name(name, false));
@@ -65,7 +63,8 @@ public class CommitWizardFileTypePage extends WizardPage {
}
}
- public void createControl(Composite parent) {
+ @Override
+ public void createControl(Composite parent) {
initializeDialogUnits(parent);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
index b1385cc0c..1a103cac8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
@@ -114,7 +114,7 @@ public class ConfigurationWizardMainPage extends CVSWizardPage {
* @return the history with the new entry appended
*/
private String[] addToHistory(String[] history, String newEntry) {
- ArrayList l = new ArrayList(Arrays.asList(history));
+ ArrayList<String> l = new ArrayList<>(Arrays.asList(history));
addToHistory(l, newEntry);
String[] r = new String[l.size()];
l.toArray(r);
@@ -135,7 +135,7 @@ public class ConfigurationWizardMainPage extends CVSWizardPage {
* @param history the current history
* @param newEntry the entry to add to the history
*/
- private void addToHistory(List history, String newEntry) {
+ private void addToHistory(List<String> history, String newEntry) {
history.remove(newEntry);
history.add(0,newEntry);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
index 294a29205..1e1226a6e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
@@ -147,7 +147,7 @@ public class GenerateDiffFileWizard extends Wizard {
if (showClosedProjects)
return allProjects;
- ArrayList accessibleProjects = new ArrayList();
+ ArrayList<IProject> accessibleProjects = new ArrayList<>();
for (int i = 0; i < allProjects.length; i++) {
if (allProjects[i].isOpen()) {
accessibleProjects.add(allProjects[i]);
@@ -908,14 +908,14 @@ public class GenerateDiffFileWizard extends Wizard {
if (viewer instanceof CheckboxTreeViewer) {
Object[] elements = ((CheckboxTreeViewer)viewer).getCheckedElements();
IResource[]selectedResources = Utils.getResources(elements);
- ArrayList result = new ArrayList();
+ ArrayList<IResource> result = new ArrayList<>();
for (int i = 0; i < selectedResources.length; i++) {
IResource resource = selectedResources[i];
if (fConfiguration.getSyncInfoSet().getSyncInfo(resource) != null) {
result.add(resource);
}
}
- return (IResource[]) result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[result.size()]);
}
}
return new IResource[0];
@@ -1014,7 +1014,7 @@ public class GenerateDiffFileWizard extends Wizard {
public void removeBinaryFiles() {
try {
- final List nonBinaryFiles = new ArrayList();
+ final List<IFile> nonBinaryFiles = new ArrayList<>();
fParticipant.getSubscriber().accept(resources, IResource.DEPTH_INFINITE, (IDiffVisitor) diff -> {
if (!isBinaryFile(diff)) {
IFile file = getFile(diff);
@@ -1023,7 +1023,7 @@ public class GenerateDiffFileWizard extends Wizard {
}
return true;
});
- resources = (IResource[]) nonBinaryFiles
+ resources = nonBinaryFiles
.toArray(new IResource[nonBinaryFiles.size()]);
} catch (CoreException e) {
CVSUIPlugin.log(e);
@@ -1304,7 +1304,7 @@ public class GenerateDiffFileWizard extends Wizard {
* Return the list of Diff command options configured on this page.
*/
public LocalOption[] getOptions() {
- List options = new ArrayList(5);
+ List<LocalOption> options = new ArrayList<>(5);
/* if(includeNewFilesOptions.getSelection()) {
options.add(Diff.INCLUDE_NEWFILES);
}
@@ -1321,7 +1321,7 @@ public class GenerateDiffFileWizard extends Wizard {
options.add(Diff.CONTEXT_FORMAT);
}
- return (LocalOption[]) options.toArray(new LocalOption[options.size()]);
+ return options.toArray(new LocalOption[options.size()]);
}
protected void setEnableUnifiedGroup(boolean enabled){
unifiedRadioGroup.setEnablement(enabled, new int[] {
@@ -1666,7 +1666,7 @@ public class GenerateDiffFileWizard extends Wizard {
/**
* List of buttons in the group. Both radio groups contain 3 elements.
*/
- private List buttons = new ArrayList(3);
+ private List<Button> buttons = new ArrayList<>(3);
/**
* Index of the selected button.
@@ -1716,7 +1716,7 @@ public class GenerateDiffFileWizard extends Wizard {
public int setSelection(int buttonCode, boolean selectEnabledOnly) {
deselectAll();
- ((Button) buttons.get(buttonCode - 1)).setSelection(true);
+ buttons.get(buttonCode - 1).setSelection(true);
selected = buttonCode - 1;
if (selectEnabledOnly)
selected = selectEnabledOnly() - 1;
@@ -1731,7 +1731,7 @@ public class GenerateDiffFileWizard extends Wizard {
public int selectEnabledOnly() {
deselectAll();
- Button selectedButton = (Button) buttons.get(selected);
+ Button selectedButton = buttons.get(selected);
if (!selectedButton.isEnabled()) {
// if the button is disabled, set selection to an enabled one
for (Iterator iterator = buttons.iterator(); iterator.hasNext();) {
@@ -1768,11 +1768,11 @@ public class GenerateDiffFileWizard extends Wizard {
// enable (or disable) given buttons
for (int i = 0; i < buttonsToChange.length; i++) {
- ((Button) this.buttons.get(buttonsToChange[i] - 1))
+ this.buttons.get(buttonsToChange[i] - 1)
.setEnabled(enabled);
}
// check whether the selected button is enabled
- if (!((Button) this.buttons.get(selected)).isEnabled()) {
+ if (!this.buttons.get(selected).isEnabled()) {
if (defaultSelection != -1)
// set the default selection and check if it's enabled
setSelection(defaultSelection, true);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizard.java
index 9e6592f0e..a23484157 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizard.java
@@ -16,6 +16,7 @@ package org.eclipse.team.internal.ccvs.ui.wizards;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.runtime.IStatus;
@@ -24,6 +25,7 @@ import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.client.Command;
+import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.actions.WorkspaceTraversalAction;
@@ -48,6 +50,7 @@ public class MergeWizard extends Wizard {
this.mappings = mappings;
}
+ @Override
public void addPages() {
setNeedsProgressMonitor(true);
TagSource tagSource = TagSource.create(resources);
@@ -57,6 +60,7 @@ public class MergeWizard extends Wizard {
addPage(page);
}
+ @Override
public boolean performFinish() {
CVSTag startTag = page.getStartTag();
@@ -123,21 +127,21 @@ public class MergeWizard extends Wizard {
}
private IResource[] getProjects(IResource[] resources) {
- Set projects = new HashSet();
+ Set<IProject> projects = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
projects.add(resource.getProject());
}
- return (IResource[]) projects.toArray(new IResource[projects.size()]);
+ return projects.toArray(new IResource[projects.size()]);
}
private Command.LocalOption[] getLocalOptions(CVSTag startTag, CVSTag endTag) {
- List options = new ArrayList();
+ List<LocalOption> options = new ArrayList<>();
if (startTag != null) {
options.add(Command.makeArgumentOption(Update.JOIN, startTag.getName()));
}
options.add(Command.makeArgumentOption(Update.JOIN, endTag.getName()));
- return (Command.LocalOption[]) options.toArray(new Command.LocalOption[options.size()]);
+ return options.toArray(new Command.LocalOption[options.size()]);
}
private IWorkbenchPart getPart() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizard.java
index 8c7e55a2c..6c5d4180e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizard.java
@@ -130,8 +130,8 @@ public class ModeWizard extends ResizableWizard {
protected static List getModeChanges(Shell shell, IResource [] resources) {
- final ArrayList changes= new ArrayList();
- final HashSet visited= new HashSet();
+ final ArrayList<ModeChange> changes = new ArrayList<>();
+ final HashSet<IResource> visited = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
final IResource currentResource = resources[i];
@@ -166,7 +166,7 @@ public class ModeWizard extends ResizableWizard {
@Override
public boolean performFinish() {
try {
- final List messages = new ArrayList();
+ final List<IStatus> messages = new ArrayList<>();
final List changes= fPage.getChanges();
if (changes.size() == 0)
return true;
@@ -215,7 +215,7 @@ public class ModeWizard extends ResizableWizard {
boolean error = false;
final MultiStatus combinedStatus = new MultiStatus(CVSUIPlugin.ID, 0, CVSUIMessages.ModeWizard_4, null);
for (int i = 0; i < messages.size(); i++) {
- final IStatus status = (IStatus)messages.get(i);
+ final IStatus status = messages.get(i);
if (status.getSeverity() == IStatus.ERROR || status.getCode() == CVSStatus.SERVER_ERROR) {
error = true;
}
@@ -248,7 +248,7 @@ public class ModeWizard extends ResizableWizard {
*/
static Map getProviderMapping(Collection changes) {
- final Map table = new HashMap();
+ final Map<RepositoryProvider, HashMap<?, ?>> table = new HashMap<>();
for (Iterator iter = changes.iterator(); iter.hasNext();) {
final ModeChange change= (ModeChange)iter.next();
@@ -262,7 +262,7 @@ public class ModeWizard extends ResizableWizard {
if (!table.containsKey(provider)) {
table.put(provider, new HashMap());
}
- final Map providerMap = (Map)table.get(provider);
+ final Map providerMap = table.get(provider);
providerMap.put(file, change.getNewMode());
}
return table;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java
index ffe5f37d0..d53b5e8ee 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java
@@ -827,7 +827,7 @@ public class ModeWizardSelectionPage extends WizardPage {
}
public List getChanges() {
- final List changes= new ArrayList();
+ final List<ModeChange> changes = new ArrayList<>();
for (Iterator iter = fChanges.iterator(); iter.hasNext();) {
final ModeChange change = (ModeChange) iter.next();
if (change.hasChanged())
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java
index 5f310ad47..42315700a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java
@@ -233,7 +233,7 @@ public class ModuleSelectionPage extends CVSWizardPage {
ISelection selection = moduleList.getSelection();
if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection)selection;
- ArrayList result = new ArrayList();
+ ArrayList<ICVSRemoteFolder> result = new ArrayList<>();
for (Iterator iter = ss.iterator(); iter.hasNext();) {
Object element = iter.next();
if (element instanceof ICVSRemoteFolder) {
@@ -242,12 +242,12 @@ public class ModuleSelectionPage extends CVSWizardPage {
ICVSRemoteFolder remoteFolder = internalCreateModuleHandle(relativePath + SEPARATOR + project.getName())[0];
result.add(remoteFolder);
} else {
- result.add(element);
+ result.add((ICVSRemoteFolder) element);
}
}
}
- return (ICVSRemoteFolder[]) result.toArray(new ICVSRemoteFolder[result.size()]);
+ return result.toArray(new ICVSRemoteFolder[result.size()]);
}
} else {
if (moduleName != null) {
@@ -264,14 +264,14 @@ public class ModuleSelectionPage extends CVSWizardPage {
if (location == null) return new ICVSRemoteFolder[0];
String[] names = name.split(","); //$NON-NLS-1$
int length = names.length;
- java.util.List folders = new ArrayList();
+ java.util.List<ICVSRemoteFolder> folders = new ArrayList<>();
for (int i = 0; i < length; i++) {
// call trim() in case the user has added spaces after the commas
String trimmedName = names[i].trim();
if (trimmedName.length() > 0)
folders.add(location.getRemoteFolder(trimmedName, CVSTag.DEFAULT));
}
- return (ICVSRemoteFolder[]) folders.toArray(new ICVSRemoteFolder[folders.size()]);
+ return folders.toArray(new ICVSRemoteFolder[folders.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java
index 9eaf0314e..a4d172fd5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java
@@ -61,8 +61,8 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage {
private IContainer folder;
private IFile selectedFile;
private ILogEntry selectedRevision;
- private Map entriesCache = new HashMap();
- private Map filesToRestore = new HashMap();
+ private Map<IFile, ILogEntry[]> entriesCache = new HashMap<>();
+ private Map<IFile, Object> filesToRestore = new HashMap<>();
private static final int WIZARD_WIDTH = 550;
@@ -435,7 +435,7 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage {
}
private ILogEntry[] getSelectedEntries() {
- return (ILogEntry[])entriesCache.get(selectedFile);
+ return entriesCache.get(selectedFile);
}
private IStorage getStorageFromLogEntry(final ILogEntry logEntry) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
index c729c0de1..b28c64aca 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
@@ -106,7 +106,7 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
}
// The input for the table viewer
- private final List fItems;
+ private final List<Item> fItems;
// Widgets
private Button fRemoveButton;
@@ -115,7 +115,7 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
protected FileTypeTable fTable;
public TextPreferencePage() {
- fItems= new ArrayList();
+ fItems= new ArrayList<>();
initializeItems();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
index e8c4eb727..1b19680d7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ExportProjectSetMainPage.java
@@ -78,7 +78,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
Button exportWorkingSets;
- ArrayList passedInSelectedProjects = new ArrayList();
+ ArrayList<IProject> passedInSelectedProjects = new ArrayList<>();
class ProjectContentProvider implements ITreePathContentProvider{
@@ -94,7 +94,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
@Override
public TreePath[] getParents(Object element) {
if (element instanceof IProject){
- ArrayList treePaths = new ArrayList();
+ ArrayList<IWorkingSet> treePaths = new ArrayList<>();
IWorkingSet[] workingSets = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager().getWorkingSets();
for (int i = 0; i < workingSets.length; i++) {
IAdaptable[] elements = workingSets[i].getElements();
@@ -105,7 +105,7 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
}
}
}
- return (TreePath[]) treePaths.toArray(new TreePath[treePaths.size()]);
+ return treePaths.toArray(new TreePath[treePaths.size()]);
}
return null;
}
@@ -201,14 +201,14 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
}
private IProject[] getProjectsForAdaptables(IAdaptable[] adaptable) {
- Set projectSet = new HashSet();
+ Set<IProject> projectSet = new HashSet<>();
for (int i = 0; i < adaptable.length; i++) {
IProject[] projects = getProjectsForObject(adaptable[i]);
if (projects != null)
projectSet.addAll(Arrays.asList(projects));
}
if (!projectSet.isEmpty())
- return (IProject[]) projectSet.toArray(new IProject[0]);
+ return projectSet.toArray(new IProject[0]);
return null;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java
index ff0af11a4..36f3aa6bf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshWizardSelectionPage.java
@@ -63,7 +63,7 @@ public class GlobalRefreshWizardSelectionPage extends WizardPage implements IDou
private TableViewer fViewer;
private IWizard wizard;
- private List createdImages;
+ private List<Image> createdImages;
class MyContentProvider extends BaseWorkbenchContentProvider {
@Override
@@ -92,7 +92,7 @@ public class GlobalRefreshWizardSelectionPage extends WizardPage implements IDou
SynchronizeWizardDescription descriptor = (SynchronizeWizardDescription)element;
ImageDescriptor d = descriptor.getImageDescriptor();
if(createdImages == null) {
- createdImages = new ArrayList(3);
+ createdImages = new ArrayList<>(3);
}
Image image = d.createImage();
createdImages.add(image);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SaveableComparison.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SaveableComparison.java
index 6ce17ab4c..c8e7ebc9f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SaveableComparison.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SaveableComparison.java
@@ -40,7 +40,7 @@ public abstract class SaveableComparison extends Saveable {
public static final int PROP_DIRTY = IWorkbenchPartConstants.PROP_DIRTY;
private boolean dirty;
- private ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
+ private ListenerList<IPropertyListener> listeners = new ListenerList<>(ListenerList.IDENTITY);
/**
* {@inheritDoc}
diff --git a/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF b/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
index 6eafd2767..98e087342 100644
--- a/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.examples.xml; singleton:=true
-Bundle-Version: 3.4.400.qualifier
+Bundle-Version: 3.4.500.qualifier
Bundle-Activator: org.eclipse.compare.examples.xml.XMLPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/examples/org.eclipse.compare.examples.xml/pom.xml b/examples/org.eclipse.compare.examples.xml/pom.xml
index 5fcbb98ce..d93b69d75 100644
--- a/examples/org.eclipse.compare.examples.xml/pom.xml
+++ b/examples/org.eclipse.compare.examples.xml/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare.examples.xml</artifactId>
- <version>3.4.400-SNAPSHOT</version>
+ <version>3.4.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java
index 756c7f401..0962fe2e3 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/AbstractMatching.java
@@ -38,7 +38,7 @@ public abstract class AbstractMatching {
/* methods used for match */
/* finds all the leaves of a tree and puts them in a vector */
- protected void findLeaves(XMLNode root, ArrayList leaves) {
+ protected void findLeaves(XMLNode root, ArrayList<XMLNode> leaves) {
if (isLeaf(root)) {
leaves.add(root);
} else {
@@ -55,7 +55,7 @@ public abstract class AbstractMatching {
}
/* Numbers all nodes of tree. The number of x is its index in the vector numbering */
- protected void numberNodes(XMLNode root, Vector numbering) {
+ protected void numberNodes(XMLNode root, Vector<XMLNode> numbering) {
if (root != null) {
numbering.add(root);
Object[] children = root.getChildren();
@@ -186,7 +186,7 @@ public abstract class AbstractMatching {
}
}
- protected int handleRangeDifferencer(Object[] xc_elements, Object[] yc_elements, ArrayList DTMatching, int distance) {
+ protected int handleRangeDifferencer(Object[] xc_elements, Object[] yc_elements, ArrayList<Match> DTMatching, int distance) {
RangeDifference[] differences= RangeDifferencer.findDifferences(new XMLComparator(xc_elements), new XMLComparator(yc_elements));
int cur_pos_left= 0;
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ChooseMatcherDropDownAction.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ChooseMatcherDropDownAction.java
index 7b414528f..d297f9265 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ChooseMatcherDropDownAction.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/ChooseMatcherDropDownAction.java
@@ -58,7 +58,7 @@ class ChooseMatcherDropDownAction extends Action implements IMenuCreator {
Set keySetIdMaps = IdMaps.keySet();
Set keySetIdMapsInternal = IdMapsInternal.keySet();
- ArrayList internalIdMapsAL= new ArrayList();
+ ArrayList<String> internalIdMapsAL= new ArrayList<>();
for (Iterator iter_internal = keySetIdMapsInternal.iterator(); iter_internal.hasNext(); ) {
String idmap_name = (String)iter_internal.next();
internalIdMapsAL.add(idmap_name);
@@ -70,7 +70,7 @@ class ChooseMatcherDropDownAction extends Action implements IMenuCreator {
}
new MenuItem(menu, SWT.SEPARATOR);
- ArrayList userIdMapsAL= new ArrayList();
+ ArrayList<String> userIdMapsAL= new ArrayList<>();
for (Iterator iter_idmaps = keySetIdMaps.iterator(); iter_idmaps.hasNext(); ) {
String idmap_name = (String)iter_idmaps.next();
userIdMapsAL.add(idmap_name);
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/OrderedMatching.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/OrderedMatching.java
index 1b55f7609..6b362f7c1 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/OrderedMatching.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/OrderedMatching.java
@@ -31,11 +31,11 @@ public class OrderedMatching extends AbstractMatching {
Object[] xc= x.getChildren();
Object[] yc= y.getChildren();
- ArrayList xc_elementsAL= new ArrayList();
- ArrayList xc_attrsAL= new ArrayList();
+ ArrayList<XMLNode> xc_elementsAL= new ArrayList<>();
+ ArrayList<XMLNode> xc_attrsAL= new ArrayList<>();
- ArrayList yc_elementsAL= new ArrayList();
- ArrayList yc_attrsAL= new ArrayList();
+ ArrayList<XMLNode> yc_elementsAL= new ArrayList<>();
+ ArrayList<XMLNode> yc_attrsAL= new ArrayList<>();
//find attributes and elements and put them in xc_elementsAL and xc_attrsAL, respectively
for (int i= 0; i < xc.length; i++) {
@@ -123,9 +123,9 @@ public class OrderedMatching extends AbstractMatching {
boolean rightTreeIsAncestor,
IProgressMonitor monitor) {
- fNLeft= new Vector();
+ fNLeft= new Vector<XMLNode>();
//numbering LeftTree: Mapping nodes in LeftTree to numbers to be used as array indexes
- fNRight= new Vector();
+ fNRight= new Vector<XMLNode>();
//numbering RightTree: Mapping nodes in RightTree to numbers to be used as array indexes
numberNodes(LeftTree, fNLeft);
numberNodes(RightTree, fNRight);
@@ -184,16 +184,16 @@ public class OrderedMatching extends AbstractMatching {
}
public int handleAttributes(
- ArrayList xc_attrs,
- ArrayList yc_attrs,
- ArrayList DTMatching) {
+ ArrayList<XMLNode> xc_attrs,
+ ArrayList<XMLNode> yc_attrs,
+ ArrayList<Match> DTMatching) {
int distance= 0;
x_for : for (
- Iterator iter_xc= xc_attrs.iterator(); iter_xc.hasNext();) {
- XMLNode x_attr= (XMLNode) iter_xc.next();
+ Iterator<XMLNode> iter_xc= xc_attrs.iterator(); iter_xc.hasNext();) {
+ XMLNode x_attr= iter_xc.next();
String x_attr_name= x_attr.getName();
- for (Iterator iter_yc= yc_attrs.iterator(); iter_yc.hasNext();) {
- XMLNode y_attr= (XMLNode) iter_yc.next();
+ for (Iterator<XMLNode> iter_yc= yc_attrs.iterator(); iter_yc.hasNext();) {
+ XMLNode y_attr= iter_yc.next();
if (y_attr.getName().equals(x_attr_name)) {
if (!y_attr.getValue().equals(x_attr.getValue()))
distance += 1;
@@ -206,8 +206,8 @@ public class OrderedMatching extends AbstractMatching {
distance += 1;
}
- for (Iterator iter_yc= yc_attrs.iterator(); iter_yc.hasNext();) {
- DTMatching.add(new Match(null, (XMLNode) iter_yc.next()));
+ for (Iterator<XMLNode> iter_yc= yc_attrs.iterator(); iter_yc.hasNext();) {
+ DTMatching.add(new Match(null, iter_yc.next()));
distance += 1;
}
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLChildren.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLChildren.java
index 58bf115d3..23174353e 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLChildren.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLChildren.java
@@ -21,12 +21,12 @@ import org.eclipse.jface.text.IDocument;
public class XMLChildren extends XMLNode {
public int children; // counts the number of children
- public HashMap childElements; // maps the name of XML child elements to their # of occurence
+ public HashMap<String,Integer> childElements; // maps the name of XML child elements to their # of occurence
public XMLChildren(String XMLType, String id, String value, String signature, IDocument doc, int start, int length) {
super(XMLType, id, value, signature, doc, start, length);
children= 0;
- childElements = new HashMap();
+ childElements = new HashMap<>();
}
}
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java
index 52a4307cb..5318bbd4b 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java
@@ -168,7 +168,7 @@ public class XMLStructureCreator implements IStructureCreator {
if (!currentParent.childElements.containsKey(raw)) {
currentParent.childElements.put(raw, Integer.valueOf(1));
} else {
- currentParent.childElements.put(raw, Integer.valueOf(((Integer) currentParent.childElements.get(raw)).intValue() + 1));
+ currentParent.childElements.put(raw, Integer.valueOf(currentParent.childElements.get(raw).intValue() + 1));
}
elementId= raw + Character.valueOf(ID_SEPARATOR) + "[" + currentParent.childElements.get(raw) + "]"; //$NON-NLS-2$ //$NON-NLS-1$
elementName= MessageFormat.format("{0} [{1}]", raw, currentParent.childElements.get(raw).toString()); //$NON-NLS-1$
diff --git a/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF b/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
index 3b156d5e0..f652691e9 100644
--- a/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.tests.core; singleton:=true
-Bundle-Version: 3.8.300.qualifier
+Bundle-Version: 3.8.400.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.team.tests.core,
diff --git a/tests/org.eclipse.team.tests.core/pom.xml b/tests/org.eclipse.team.tests.core/pom.xml
index 226bc827c..4ad836d8a 100644
--- a/tests/org.eclipse.team.tests.core/pom.xml
+++ b/tests/org.eclipse.team.tests.core/pom.xml
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.tests.core</artifactId>
- <version>3.8.300-SNAPSHOT</version>
+ <version>3.8.400-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java
index ddc1a80e2..b69c0ca0c 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/ResourceContentTests.java
@@ -100,7 +100,7 @@ public class ResourceContentTests extends TeamTest {
private void assertContentsMatch(IResource[] resources) {
Set paths = getPaths(ResourcesPlugin.getWorkspace().getRoot());
- Set resourceSet = new HashSet();
+ Set<Object> resourceSet = new HashSet<>();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
resourceSet.add(resource);
@@ -122,7 +122,7 @@ public class ResourceContentTests extends TeamTest {
}
private Set getPaths(Object root) {
- Set result = new HashSet();
+ Set<Object> result = new HashSet<>();
Object[] elements = provider.getElements(root);
for (int i = 0; i < elements.length; i++) {
Object object = elements[i];
@@ -135,7 +135,7 @@ public class ResourceContentTests extends TeamTest {
private Set getPaths(ResourceModelContentProvider provider, TreePath path) {
Object[] children = provider.getChildren(path);
- Set result = new HashSet();
+ Set<TreePath> result = new HashSet<>();
if (children.length == 0)
result.add(path);
for (int i = 0; i < children.length; i++) {
@@ -171,7 +171,7 @@ public class ResourceContentTests extends TeamTest {
}
private IResource[] asResources(IProject project, String[] resourcePaths) {
- List resources = new ArrayList();
+ List<IResource> resources = new ArrayList<>();
for (int i = 0; i < resourcePaths.length; i++) {
String path = resourcePaths[i];
if (path.endsWith("/")) {

Back to the top