diff options
author | Alexander Kurtakov | 2017-07-25 16:06:05 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-07-25 16:06:05 +0000 |
commit | a5e1a790fce0ff0a0f9f166694b1e56324b185f4 (patch) | |
tree | 48b728800254c949c579df27f3f090bb1c24e8ad /bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/DiffChangeEvent.java | |
parent | 3734ce46345e063654bf3bdc0ff6a3096bc0d501 (diff) | |
download | eclipse.platform.team-a5e1a790fce0ff0a0f9f166694b1e56324b185f4.tar.gz eclipse.platform.team-a5e1a790fce0ff0a0f9f166694b1e56324b185f4.tar.xz eclipse.platform.team-a5e1a790fce0ff0a0f9f166694b1e56324b185f4.zip |
Bug 520159 - Modernize o.e.team.core S4_8_0_M1I20170808-2000I20170807-2000I20170806-2000I20170805-1500I20170804-2000I20170802-2000I20170802-0800I20170801-2000I20170801-0800I20170731-2000I20170731-0800I20170730-2000I20170729-2000I20170728-2000I20170727-2000I20170727-0610I20170726-2000I20170725-2000
Take 2:
* Generify.
* Replace non-javadoc with @Override
* Convert to lambdas
Change-Id: Ia44170d3e752ad6513f007964463692e1cc6288e
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/DiffChangeEvent.java')
-rw-r--r-- | bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/DiffChangeEvent.java | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/DiffChangeEvent.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/DiffChangeEvent.java index bd7fc2982..6fb7515bf 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/DiffChangeEvent.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/mapping/DiffChangeEvent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,13 +25,13 @@ public class DiffChangeEvent implements IDiffChangeEvent { // List that accumulate changes // SyncInfo - private Map changedResources = new HashMap(); - private Set removedResources = new HashSet(); - private Map addedResources = new HashMap(); + private Map<IPath, IDiff> changedResources = new HashMap<>(); + private Set<IPath> removedResources = new HashSet<>(); + private Map<IPath, IDiff> addedResources = new HashMap<>(); private boolean reset = false; - private List errors = new ArrayList(); + private List<IStatus> errors = new ArrayList<>(); /** * Create a diff change event @@ -41,32 +41,24 @@ public class DiffChangeEvent implements IDiffChangeEvent { this.tree = tree; } - /* (non-Javadoc) - * @see org.eclipse.team.core.delta.ISyncDeltaChangeEvent#getTree() - */ + @Override public IDiffTree getTree() { return tree; } - /* (non-Javadoc) - * @see org.eclipse.team.core.delta.ISyncDeltaChangeEvent#getAdditions() - */ + @Override public IDiff[] getAdditions() { - return (IDiff[]) addedResources.values().toArray(new IDiff[addedResources.size()]); + return addedResources.values().toArray(new IDiff[addedResources.size()]); } - /* (non-Javadoc) - * @see org.eclipse.team.core.delta.ISyncDeltaChangeEvent#getRemovals() - */ + @Override public IPath[] getRemovals() { - return (IPath[]) removedResources.toArray(new IPath[removedResources.size()]); + return removedResources.toArray(new IPath[removedResources.size()]); } - /* (non-Javadoc) - * @see org.eclipse.team.core.delta.ISyncDeltaChangeEvent#getChanges() - */ + @Override public IDiff[] getChanges() { - return (IDiff[]) changedResources.values().toArray(new IDiff[changedResources.size()]); + return changedResources.values().toArray(new IDiff[changedResources.size()]); } public void added(IDiff delta) { @@ -116,8 +108,9 @@ public class DiffChangeEvent implements IDiffChangeEvent { errors .add(status); } + @Override public IStatus[] getErrors() { - return (IStatus[]) errors.toArray(new IStatus[errors.size()]); + return errors.toArray(new IStatus[errors.size()]); } } |