diff options
Diffstat (limited to 'bundles/org.eclipse.team.core/src/org/eclipse/team/core')
20 files changed, 135 insertions, 214 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java index 9c1d1fe5b..268892380 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ProjectSetSerializationContext.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 @@ -26,7 +26,7 @@ import org.eclipse.core.resources.IProject; public class ProjectSetSerializationContext { private final String filename; - private final Map properties = new HashMap(); + private final Map<String, Object> properties = new HashMap<>(); /** * Create a serialization context with no filename diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java index 75f302ace..b75404a15 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.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 @@ -55,7 +55,7 @@ import org.eclipse.team.internal.core.TeamPlugin; */ public abstract class RepositoryProviderType extends PlatformObject { - private static Map allProviderTypes = new HashMap(); + private static Map<String, RepositoryProviderType> allProviderTypes = new HashMap<>(); private String id; @@ -73,7 +73,7 @@ public abstract class RepositoryProviderType extends PlatformObject { * @see #getID() */ public static RepositoryProviderType getProviderType(String id) { - RepositoryProviderType type = (RepositoryProviderType) allProviderTypes.get(id); + RepositoryProviderType type = allProviderTypes.get(id); if(type != null) return type; diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ScmUrlImportDescription.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ScmUrlImportDescription.java index b8f66e462..5de9f9f12 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ScmUrlImportDescription.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ScmUrlImportDescription.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. + * Copyright (c) 2011, 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 @@ -32,7 +32,7 @@ import java.util.HashMap; public class ScmUrlImportDescription { private String url; private String project; - private HashMap properties; + private HashMap<String, Object> properties; public ScmUrlImportDescription(String url, String project) { this.url = url; @@ -73,7 +73,7 @@ public class ScmUrlImportDescription { */ public synchronized void setProperty(String key, Object value) { if (properties == null) { - properties = new HashMap(); + properties = new HashMap<>(); } if (value == null) { properties.remove(key); diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java index 538c0f6d0..675a72928 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java @@ -67,7 +67,7 @@ public final class Team { private final static FileContentManager fFileContentManager; - private static List fBundleImporters; + private static List<IBundleImporter> fBundleImporters; static { fFileContentManager= new FileContentManager(); @@ -604,7 +604,7 @@ public final class Team { */ public synchronized static IBundleImporter[] getBundleImporters() { if (fBundleImporters == null) { - fBundleImporters = new ArrayList(); + fBundleImporters = new ArrayList<>(); IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(TeamPlugin.EXTENSION_POINT_BUNDLE_IMPORTERS); if (point != null) { IConfigurationElement[] infos = point.getConfigurationElements(); @@ -613,6 +613,6 @@ public final class Team { } } } - return (IBundleImporter[]) fBundleImporters.toArray(new IBundleImporter[fBundleImporters.size()]); + return fBundleImporters.toArray(new IBundleImporter[fBundleImporters.size()]); } } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java index 4d9a6d298..be0ccea7b 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/FastDiffFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -27,6 +27,7 @@ public abstract class FastDiffFilter extends DiffFilter { public static final FastDiffFilter getStateFilter(final int[] states, final int mask) { return new FastDiffFilter() { + @Override public boolean select(IDiff node) { int status = ((Diff)node).getStatus(); for (int i = 0; i < states.length; i++) { @@ -40,9 +41,7 @@ public abstract class FastDiffFilter extends DiffFilter { }; } - /* (non-Javadoc) - * @see org.eclipse.team.core.diff.DiffNodeFilter#select(org.eclipse.team.core.diff.IDiffNode, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override public final boolean select(IDiff diff, IProgressMonitor monitor) { return select(diff); } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java index 575b593c0..fe514dbc8 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/ThreeWayDiff.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 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 @@ -77,30 +77,22 @@ public class ThreeWayDiff extends Diff implements IThreeWayDiff { return CHANGE; } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.IThreeWayDelta#getLocalChange() - */ + @Override public ITwoWayDiff getLocalChange() { return localChange; } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.IThreeWayDelta#getRemoteChange() - */ + @Override public ITwoWayDiff getRemoteChange() { return remoteChange; } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.IThreeWayDelta#getDirection() - */ + @Override public int getDirection() { return getStatus() & CONFLICTING; } - /* (non-Javadoc) - * @see org.eclipse.team.core.diff.IDiffNode#toDiffString() - */ + @Override public String toDiffString() { int kind = getKind(); String label = ""; //$NON-NLS-1$ @@ -113,9 +105,7 @@ public class ThreeWayDiff extends Diff implements IThreeWayDiff { return label; } - /* (non-Javadoc) - * @see org.eclipse.team.core.diff.provider.Diff#equals(java.lang.Object) - */ + @Override public boolean equals(Object obj) { if (obj == this) return true; diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/TwoWayDiff.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/TwoWayDiff.java index 01e261f16..8b04f82b6 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/TwoWayDiff.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/diff/provider/TwoWayDiff.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 @@ -45,30 +45,22 @@ public class TwoWayDiff extends Diff implements ITwoWayDiff { super(path, (kind & KIND_MASK) | (flags & ~KIND_MASK)); } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.ITwoWayDelta#getFlags() - */ + @Override public int getFlags() { return getStatus() & ~KIND_MASK; } - /* (non-Javadoc) - * @see org.eclipse.team.core.delta.ITwoWayDelta#getMovedToPath() - */ + @Override public IPath getToPath() { return null; } - /* (non-Javadoc) - * @see org.eclipse.team.core.delta.ITwoWayDelta#getMovedFromPath() - */ + @Override public IPath getFromPath() { return null; } - /* (non-Javadoc) - * @see org.eclipse.team.core.diff.provider.Diff#equals(java.lang.Object) - */ + @Override public boolean equals(Object obj) { if (obj == this) return true; diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java index 6a267a052..86ff0d547 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/DelegatingStorageMerger.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -69,9 +69,7 @@ public class DelegatingStorageMerger implements IStorageMerger { return instance; } - /* (non-Javadoc) - * @see org.eclipse.team.core.mapping.IStorageMerger#merge(java.io.OutputStream, java.lang.String, org.eclipse.core.resources.IStorage, org.eclipse.core.resources.IStorage, org.eclipse.core.resources.IStorage, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override public IStatus merge(OutputStream output, String outputEncoding, IStorage ancestor, IStorage target, IStorage other, IProgressMonitor monitor) throws CoreException { @@ -217,9 +215,7 @@ public class DelegatingStorageMerger implements IStorageMerger { return null; } - /* (non-Javadoc) - * @see org.eclipse.team.core.mapping.IStorageMerger#canMergeWithoutAncestor() - */ + @Override public boolean canMergeWithoutAncestor() { return false; } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ResourceMappingMerger.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ResourceMappingMerger.java index 41c4ffcc8..90fdd515c 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ResourceMappingMerger.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ResourceMappingMerger.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 @@ -37,9 +37,7 @@ import org.eclipse.team.core.mapping.provider.MergeStatus; */ public abstract class ResourceMappingMerger implements IResourceMappingMerger { - /* (non-Javadoc) - * @see org.eclipse.team.core.mapping.IResourceMappingMerger#validateMerge(org.eclipse.team.core.mapping.IMergeContext, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override public IStatus validateMerge(IMergeContext mergeContext, IProgressMonitor monitor) { return Status.OK_STATUS; } @@ -61,6 +59,7 @@ public abstract class ResourceMappingMerger implements IResourceMappingMerger { * model provider. * @see org.eclipse.team.core.mapping.IResourceMappingMerger#getMergeRule(org.eclipse.team.core.mapping.IMergeContext) */ + @Override public ISchedulingRule getMergeRule(IMergeContext context) { ResourceMapping[] mappings = context.getScope().getMappings(getModelProvider().getId()); ISchedulingRule rule = null; @@ -88,6 +87,7 @@ public abstract class ResourceMappingMerger implements IResourceMappingMerger { * @throws CoreException if an error occurred * @see org.eclipse.team.core.mapping.IResourceMappingMerger#merge(org.eclipse.team.core.mapping.IMergeContext, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public IStatus merge(IMergeContext mergeContext, IProgressMonitor monitor) throws CoreException { IDiff[] deltas = getSetToMerge(mergeContext); IStatus status = mergeContext.merge(deltas, false /* don't force */, monitor); @@ -96,7 +96,7 @@ public abstract class ResourceMappingMerger implements IResourceMappingMerger { private IDiff[] getSetToMerge(IMergeContext mergeContext) { ResourceMapping[] mappings = mergeContext.getScope().getMappings(getModelProvider().getDescriptor().getId()); - Set result = new HashSet(); + Set<IDiff> result = new HashSet<>(); for (int i = 0; i < mappings.length; i++) { ResourceMapping mapping = mappings[i]; ResourceTraversal[] traversals = mergeContext.getScope().getTraversals(mapping); @@ -106,7 +106,7 @@ public abstract class ResourceMappingMerger implements IResourceMappingMerger { result.add(delta); } } - return (IDiff[]) result.toArray(new IDiff[result.size()]); + return result.toArray(new IDiff[result.size()]); } private IStatus covertFilesToMappings(IStatus status, IMergeContext mergeContext) { diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeStatus.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeStatus.java index 2a35b63bf..02fc2eb45 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeStatus.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeStatus.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 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 @@ -58,17 +58,13 @@ public class MergeStatus extends Status implements IMergeStatus { this.conflictingFiles = files; } - /* (non-Javadoc) - * @see org.eclipse.team.ui.mapping.IMergeStatus#getConflictingMappings() - */ - public ResourceMapping[] getConflictingMappings() { + @Override + public ResourceMapping[] getConflictingMappings() { return conflictingMappings; } - /* (non-Javadoc) - * @see org.eclipse.team.ui.mapping.IMergeStatus#getConflictingFiles() - */ - public IFile[] getConflictingFiles() { + @Override + public IFile[] getConflictingFiles() { return conflictingFiles; } } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java index ee7df0f17..b0e193110 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 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 @@ -65,7 +65,7 @@ import org.eclipse.team.internal.core.mapping.SyncInfoToDiffConverter; */ abstract public class Subscriber { - private List listeners = new ArrayList(1); + private List<ISubscriberChangeListener> listeners = new ArrayList<>(1); /** * Return the name of this subscription, in a format that is @@ -274,16 +274,18 @@ abstract public class Subscriber { ISubscriberChangeListener[] allListeners; // Copy the listener list so we're not calling client code while synchronized synchronized (listeners) { - allListeners = (ISubscriberChangeListener[]) listeners.toArray(new ISubscriberChangeListener[listeners.size()]); + allListeners = listeners.toArray(new ISubscriberChangeListener[listeners.size()]); } // Notify the listeners safely so all will receive notification for (int i = 0; i < allListeners.length; i++) { final ISubscriberChangeListener listener = allListeners[i]; SafeRunner.run(new ISafeRunnable() { + @Override public void handleException(Throwable exception) { // don't log the exception....it is already being logged in // Platform#run } + @Override public void run() throws Exception { listener.subscriberResourceChanged(deltas); } @@ -500,6 +502,7 @@ abstract public class Subscriber { final int[] direction = new int[] { 0 }; final int[] kind = new int[] { 0 }; accept(traversals, new IDiffVisitor() { + @Override public boolean visit(IDiff diff) { if (diff instanceof IThreeWayDiff) { IThreeWayDiff twd = (IThreeWayDiff) diff; diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java index a5d032422..b80021924 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java @@ -27,7 +27,7 @@ import org.eclipse.team.core.mapping.provider.SynchronizationScopeManager; public class SubscriberScopeManager extends SynchronizationScopeManager implements ISubscriberChangeListener { private final Subscriber subscriber; - private Map participants = new HashMap(); + private Map<ModelProvider, ISynchronizationScopeParticipant> participants = new HashMap<>(); /** * Create a manager for the given subscriber and input. @@ -72,29 +72,23 @@ public class SubscriberScopeManager extends SynchronizationScopeManager implemen @Override public void initialize(IProgressMonitor monitor) throws CoreException { - ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { - @Override - public void run(IProgressMonitor monitor) throws CoreException { - SubscriberScopeManager.super.initialize(monitor); - hookupParticipants(); - getSubscriber().addListener(SubscriberScopeManager.this); - } + ResourcesPlugin.getWorkspace().run((IWorkspaceRunnable) monitor1 -> { + SubscriberScopeManager.super.initialize(monitor1); + hookupParticipants(); + getSubscriber().addListener(SubscriberScopeManager.this); }, getSchedulingRule(), IResource.NONE, monitor); } @Override public ResourceTraversal[] refresh(final ResourceMapping[] mappings, IProgressMonitor monitor) throws CoreException { - final List result = new ArrayList(1); - ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { - @Override - public void run(IProgressMonitor monitor) throws CoreException { - result.add(SubscriberScopeManager.super.refresh(mappings, monitor)); - hookupParticipants(); - } + final List<ResourceTraversal[]> result = new ArrayList<>(1); + ResourcesPlugin.getWorkspace().run((IWorkspaceRunnable) monitor1 -> { + result.add(SubscriberScopeManager.super.refresh(mappings, monitor1)); + hookupParticipants(); }, getSchedulingRule(), IResource.NONE, monitor); if (result.isEmpty()) return new ResourceTraversal[0]; - return (ResourceTraversal[])result.get(0); + return result.get(0); } /* @@ -145,8 +139,8 @@ public class SubscriberScopeManager extends SynchronizationScopeManager implemen } private void fireChange(final IResource[] resources, final IProject[] projects) { - final Set result = new HashSet(); - ISynchronizationScopeParticipant[] handlers = (ISynchronizationScopeParticipant[]) participants.values().toArray(new ISynchronizationScopeParticipant[participants.size()]); + final Set<ResourceMapping> result = new HashSet<>(); + ISynchronizationScopeParticipant[] handlers = participants.values().toArray(new ISynchronizationScopeParticipant[participants.size()]); for (int i = 0; i < handlers.length; i++) { final ISynchronizationScopeParticipant participant = handlers[i]; SafeRunner.run(new ISafeRunnable() { @@ -165,7 +159,7 @@ public class SubscriberScopeManager extends SynchronizationScopeManager implemen }); } if (!result.isEmpty()) { - refresh((ResourceMapping[]) result.toArray(new ResourceMapping[result.size()])); + refresh(result.toArray(new ResourceMapping[result.size()])); } } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java index a74dbc946..c987c54ec 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/FastSyncInfoFilter.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 @@ -68,9 +68,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter { public AndSyncInfoFilter(FastSyncInfoFilter[] filters) { super(filters); } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.FastSyncInfoFilter#select(org.eclipse.team.core.synchronize.SyncInfo) - */ + @Override public boolean select(SyncInfo info) { for (int i = 0; i < filters.length; i++) { FastSyncInfoFilter filter = filters[i]; @@ -86,9 +84,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter { * Selects <code>SyncInfo</code> instances that are auto-mergable. */ public static class AutomergableFilter extends FastSyncInfoFilter { - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.FastSyncInfoFilter#select(org.eclipse.team.core.synchronize.SyncInfo) - */ + @Override public boolean select(SyncInfo info) { return (info.getKind() & SyncInfo.AUTOMERGE_CONFLICT) != 0; } @@ -98,9 +94,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter { * Selects <code>SyncInfo</code> instances that are pseudo-conflicts. */ public static class PseudoConflictFilter extends FastSyncInfoFilter { - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.FastSyncInfoFilter#select(org.eclipse.team.core.synchronize.SyncInfo) - */ + @Override public boolean select(SyncInfo info) { return info.getKind() != 0 && (info.getKind() & SyncInfo.PSEUDO_CONFLICT) == 0; } @@ -117,9 +111,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter { public OrSyncInfoFilter(FastSyncInfoFilter[] filters) { super(filters); } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.FastSyncInfoFilter#select(org.eclipse.team.core.synchronize.SyncInfo) - */ + @Override public boolean select(SyncInfo info) { for (int i = 0; i < filters.length; i++) { FastSyncInfoFilter filter = filters[i]; @@ -154,9 +146,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter { public SyncInfoChangeTypeFilter(int change) { this(new int[]{change}); } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.FastSyncInfoFilter#select(org.eclipse.team.core.synchronize.SyncInfo) - */ + @Override public boolean select(SyncInfo info) { int syncKind = info.getKind(); for (int i = 0; i < changeFilters.length; i++) { @@ -191,9 +181,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter { public SyncInfoDirectionFilter(int direction) { this(new int[] { direction }); } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.FastSyncInfoFilter#select(org.eclipse.team.core.synchronize.SyncInfo) - */ + @Override public boolean select(SyncInfo info) { int syncKind = info.getKind(); for (int i = 0; i < directionFilters.length; i++) { @@ -216,9 +204,7 @@ public class FastSyncInfoFilter extends SyncInfoFilter { return info.getKind() != 0; } - /* (non-Javadoc) - * @see org.eclipse.team.core.subscribers.SyncInfoFilter#select(org.eclipse.team.core.subscribers.SyncInfo, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override public final boolean select(SyncInfo info, IProgressMonitor monitor) { return select(info); } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoFilter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoFilter.java index 48af21eea..ffe405acc 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoFilter.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoFilter.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 @@ -54,9 +54,7 @@ public abstract class SyncInfoFilter { criteria = new ContentComparator(ignoreWhitespace); } - /* (non-Javadoc) - * @see org.eclipse.team.core.synchronize.SyncInfoFilter#select(org.eclipse.team.core.synchronize.SyncInfo, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override public boolean select(SyncInfo info, IProgressMonitor monitor) { IResourceVariant remote = info.getRemote(); IResource local = info.getLocal(); diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent.java index 8c2446182..860c233da 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 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 @@ -27,13 +27,13 @@ public class SyncInfoSetChangeEvent implements ISyncInfoSetChangeEvent { // List that accumulate changes // SyncInfo - private Map changedResources = new HashMap(); - private Set removedResources = new HashSet(); - private Map addedResources = new HashMap(); + private Map<IResource, SyncInfo> changedResources = new HashMap<>(); + private Set<IResource> removedResources = new HashSet<>(); + private Map<IResource, SyncInfo> addedResources = new HashMap<>(); private boolean reset = false; - private List errors = new ArrayList(); + private List<ITeamStatus> errors = new ArrayList<>(); public SyncInfoSetChangeEvent(SyncInfoSet set) { super(); @@ -72,18 +72,22 @@ public class SyncInfoSetChangeEvent implements ISyncInfoSetChangeEvent { changedResources.put(resource, info); } + @Override public SyncInfo[] getAddedResources() { - return (SyncInfo[]) addedResources.values().toArray(new SyncInfo[addedResources.size()]); + return addedResources.values().toArray(new SyncInfo[addedResources.size()]); } + @Override public SyncInfo[] getChangedResources() { - return (SyncInfo[]) changedResources.values().toArray(new SyncInfo[changedResources.size()]); + return changedResources.values().toArray(new SyncInfo[changedResources.size()]); } + @Override public IResource[] getRemovedResources() { - return (IResource[]) removedResources.toArray(new IResource[removedResources.size()]); + return removedResources.toArray(new IResource[removedResources.size()]); } + @Override public SyncInfoSet getSet() { return set; } @@ -105,6 +109,6 @@ public class SyncInfoSetChangeEvent implements ISyncInfoSetChangeEvent { } public ITeamStatus[] getErrors() { - return (ITeamStatus[]) errors.toArray(new ITeamStatus[errors.size()]); + return errors.toArray(new ITeamStatus[errors.size()]); } } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java index c78c3e953..3888a19b0 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.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 @@ -46,8 +46,9 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre * @return the array of resources whose corresponding variants have changed * @throws TeamException */ + @Override public IResource[] refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException { - List changedResources = new ArrayList(); + List<IResource> changedResources = new ArrayList<>(); monitor.beginTask(null, 100 * resources.length); for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; @@ -55,7 +56,7 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre changedResources.addAll(Arrays.asList(changed)); } monitor.done(); - return (IResource[]) changedResources.toArray(new IResource[changedResources.size()]); + return changedResources.toArray(new IResource[changedResources.size()]); } /** @@ -109,9 +110,9 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre * @throws TeamException */ protected IResource[] collectChanges(IResource local, IResourceVariant remote, int depth, IProgressMonitor monitor) throws TeamException { - List changedResources = new ArrayList(); + List<IResource> changedResources = new ArrayList<>(); collectChanges(local, remote, changedResources, depth, monitor); - return (IResource[]) changedResources.toArray(new IResource[changedResources.size()]); + return changedResources.toArray(new IResource[changedResources.size()]); } /** @@ -164,30 +165,30 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre */ protected abstract boolean setVariant(IResource local, IResourceVariant remote) throws TeamException; - private void collectChanges(IResource local, IResourceVariant remote, Collection changedResources, int depth, IProgressMonitor monitor) throws TeamException { + private void collectChanges(IResource local, IResourceVariant remote, Collection<IResource> changedResources, int depth, IProgressMonitor monitor) throws TeamException { boolean changed = setVariant(local, remote); if (changed) { changedResources.add(local); } if (depth == IResource.DEPTH_ZERO) return; - Map children = mergedMembers(local, remote, monitor); - for (Iterator it = children.keySet().iterator(); it.hasNext();) { - IResource localChild = (IResource) it.next(); - IResourceVariant remoteChild = (IResourceVariant)children.get(localChild); + Map<IResource, IResourceVariant> children = mergedMembers(local, remote, monitor); + for (Iterator<IResource> it = children.keySet().iterator(); it.hasNext();) { + IResource localChild = it.next(); + IResourceVariant remoteChild = children.get(localChild); collectChanges(localChild, remoteChild, changedResources, depth == IResource.DEPTH_INFINITE ? IResource.DEPTH_INFINITE : IResource.DEPTH_ZERO, monitor); } - IResource[] cleared = collectedMembers(local, (IResource[]) children.keySet().toArray(new IResource[children.keySet().size()])); + IResource[] cleared = collectedMembers(local, children.keySet().toArray(new IResource[children.keySet().size()])); changedResources.addAll(Arrays.asList(cleared)); monitor.worked(1); } - private Map mergedMembers(IResource local, IResourceVariant remote, IProgressMonitor progress) throws TeamException { + private Map<IResource, IResourceVariant> mergedMembers(IResource local, IResourceVariant remote, IProgressMonitor progress) throws TeamException { // {IResource -> IResourceVariant} - Map mergedResources = new HashMap(); + Map<IResource, IResourceVariant> mergedResources = new HashMap<>(); IResourceVariant[] remoteChildren; if (remote == null) { @@ -200,12 +201,12 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre IResource[] localChildren = members(local); if (remoteChildren.length > 0 || localChildren.length > 0) { - Set allSet = new HashSet(20); - Map localSet = null; - Map remoteSet = null; + Set<String> allSet = new HashSet<>(20); + Map<String, IResource> localSet = null; + Map<String, IResourceVariant> remoteSet = null; if (localChildren.length > 0) { - localSet = new HashMap(10); + localSet = new HashMap<>(10); for (int i = 0; i < localChildren.length; i++) { IResource localChild = localChildren[i]; String name = localChild.getName(); @@ -215,7 +216,7 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre } if (remoteChildren.length > 0) { - remoteSet = new HashMap(10); + remoteSet = new HashMap<>(10); for (int i = 0; i < remoteChildren.length; i++) { IResourceVariant remoteChild = remoteChildren[i]; String name = remoteChild.getName(); diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java index 9f38007aa..90ac851b9 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/PersistantResourceVariantByteStore.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 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 @@ -43,9 +43,7 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore getSynchronizer().add(syncName); } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.ResourceVariantByteStore#dispose() - */ + @Override public void dispose() { getSynchronizer().remove(getSyncName()); } @@ -58,9 +56,7 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore return syncName; } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.ResourceVariantByteStore#getBytes(org.eclipse.core.resources.IResource) - */ + @Override public byte[] getBytes(IResource resource) throws TeamException { byte[] syncBytes = internalGetSyncBytes(resource); if (syncBytes != null && equals(syncBytes, NO_REMOTE)) { @@ -70,9 +66,7 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore return syncBytes; } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.ResourceVariantByteStore#setBytes(org.eclipse.core.resources.IResource, byte[]) - */ + @Override public boolean setBytes(IResource resource, byte[] bytes) throws TeamException { Assert.isNotNull(bytes); byte[] oldBytes = internalGetSyncBytes(resource); @@ -85,9 +79,7 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore } } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.ResourceVariantByteStore#flushBytes(org.eclipse.core.resources.IResource, int) - */ + @Override public boolean flushBytes(IResource resource, int depth) throws TeamException { if (resource.exists() || resource.isPhantom()) { try { @@ -122,13 +114,12 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore * <code>getBytes(resource)</code> will return <code>null</code>. * @return <code>true</code> if this changes the remote sync bytes */ + @Override public boolean deleteBytes(IResource resource) throws TeamException { return setBytes(resource, NO_REMOTE); } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.ResourceVariantByteStore#members(org.eclipse.core.resources.IResource) - */ + @Override public IResource[] members(IResource resource) throws TeamException { if(resource.getType() == IResource.FILE) { return new IResource[0]; @@ -136,14 +127,14 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore try { // Filter and return only resources that have sync bytes in the cache. IResource[] members = ((IContainer)resource).members(true /* include phantoms */); - List filteredMembers = new ArrayList(members.length); + List<IResource> filteredMembers = new ArrayList<>(members.length); for (int i = 0; i < members.length; i++) { IResource member = members[i]; if(getBytes(member) != null) { filteredMembers.add(member); } } - return (IResource[]) filteredMembers.toArray(new IResource[filteredMembers.size()]); + return filteredMembers.toArray(new IResource[filteredMembers.size()]); } catch (CoreException e) { throw TeamException.asTeamException(e); } @@ -161,9 +152,7 @@ public class PersistantResourceVariantByteStore extends ResourceVariantByteStore } } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.ResourceVariantByteStore#run(org.eclipse.core.resources.IWorkspaceRunnable, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override public void run(IResource root, IWorkspaceRunnable runnable, IProgressMonitor monitor) throws TeamException { try { diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTree.java index 12cf6faeb..e3b5c9f85 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTree.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTree.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 @@ -11,8 +11,6 @@ package org.eclipse.team.core.variants; import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.team.core.TeamException; @@ -38,30 +36,22 @@ public abstract class ResourceVariantTree extends AbstractResourceVariantTree { this.store = store; } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.IResourceVariantTree#members(org.eclipse.core.resources.IResource) - */ + @Override public IResource[] members(IResource resource) throws TeamException { return getByteStore().members(resource); } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.IResourceVariantTree#hasResourceVariant(org.eclipse.core.resources.IResource) - */ + @Override public boolean hasResourceVariant(IResource resource) throws TeamException { return getByteStore().getBytes(resource) != null; } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.IResourceVariantTree#flushVariants(org.eclipse.core.resources.IResource, int) - */ + @Override public void flushVariants(IResource resource, int depth) throws TeamException { getByteStore().flushBytes(resource, depth); } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.AbstractResourceVariantTree#setVariant(org.eclipse.core.resources.IResource, org.eclipse.team.core.variants.IResourceVariant) - */ + @Override protected boolean setVariant(IResource local, IResourceVariant remote) throws TeamException { ResourceVariantByteStore cache = getByteStore(); byte[] newRemoteBytes = getBytes(local, remote); @@ -100,18 +90,12 @@ public abstract class ResourceVariantTree extends AbstractResourceVariantTree { return remote.asBytes(); } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.AbstractResourceVariantTree#collectChanges(org.eclipse.core.resources.IResource, org.eclipse.team.core.variants.IResourceVariant, int, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override protected IResource[] collectChanges(final IResource local, final IResourceVariant remote, final int depth, IProgressMonitor monitor) throws TeamException { final IResource[][] resources = new IResource[][] { null }; - getByteStore().run(local, new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - resources[0] = ResourceVariantTree.super.collectChanges(local, remote, depth, monitor); - } - }, monitor); + getByteStore().run(local, monitor1 -> resources[0] = ResourceVariantTree.super.collectChanges(local, remote, depth, monitor1), monitor); return resources[0]; } } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java index 7c7c64e35..b58ccaeac 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ResourceVariantTreeSubscriber.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 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 @@ -31,9 +31,7 @@ import org.eclipse.team.internal.core.*; */ public abstract class ResourceVariantTreeSubscriber extends Subscriber { - /* (non-Javadoc) - * @see org.eclipse.team.core.subscribers.Subscriber#getSyncInfo(org.eclipse.core.resources.IResource) - */ + @Override public SyncInfo getSyncInfo(IResource resource) throws TeamException { if (!isSupervised(resource)) return null; IResourceVariant remoteResource = getRemoteTree().getResourceVariant(resource); @@ -61,15 +59,13 @@ public abstract class ResourceVariantTreeSubscriber extends Subscriber { return info; } - /* (non-Javadoc) - * @see org.eclipse.team.core.subscribers.Subscriber#members(org.eclipse.core.resources.IResource) - */ + @Override public IResource[] members(IResource resource) throws TeamException { if(resource.getType() == IResource.FILE) { return new IResource[0]; } try { - Set allMembers = new HashSet(); + Set<IResource> allMembers = new HashSet<>(); try { allMembers.addAll(Arrays.asList(((IContainer)resource).members())); } catch (CoreException e) { @@ -93,19 +89,17 @@ public abstract class ResourceVariantTreeSubscriber extends Subscriber { iterator.remove(); } } - return (IResource[]) allMembers.toArray(new IResource[allMembers.size()]); + return allMembers.toArray(new IResource[allMembers.size()]); } catch (CoreException e) { throw TeamException.asTeamException(e); } } - /* (non-Javadoc) - * @see org.eclipse.team.core.subscribers.Subscriber#refresh(org.eclipse.core.resources.IResource[], int, org.eclipse.core.runtime.IProgressMonitor) - */ + @Override public void refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException { monitor = Policy.monitorFor(monitor); - List errors = new ArrayList(); - List cancels = new ArrayList(); + List<IStatus> errors = new ArrayList<>(); + List<IStatus> cancels = new ArrayList<>(); try { monitor.beginTask(null, 1000 * resources.length); for (int i = 0; i < resources.length; i++) { @@ -127,7 +121,7 @@ public abstract class ResourceVariantTreeSubscriber extends Subscriber { if (!cancels.isEmpty()) { errors.addAll(cancels); throw new TeamException(new MultiStatus(TeamPlugin.ID, 0, - (IStatus[]) errors.toArray(new IStatus[errors.size()]), + errors.toArray(new IStatus[errors.size()]), NLS.bind( Messages.ResourceVariantTreeSubscriber_3, (new Object[] { getName(), @@ -135,6 +129,7 @@ public abstract class ResourceVariantTreeSubscriber extends Subscriber { Integer.toString(resources.length), Integer.toString(cancels.size()) })), null) { + @Override public int getSeverity() { // we want to display status as an error return IStatus.ERROR; @@ -142,12 +137,12 @@ public abstract class ResourceVariantTreeSubscriber extends Subscriber { }); } throw new TeamException(new MultiStatus(TeamPlugin.ID, 0, - (IStatus[]) errors.toArray(new IStatus[errors.size()]), + errors.toArray(new IStatus[errors.size()]), NLS.bind(Messages.ResourceVariantTreeSubscriber_1, (new Object[] {getName(), Integer.toString(numSuccess), Integer.toString(resources.length)})), null)); } if (!cancels.isEmpty()) { throw new OperationCanceledException( - ((IStatus) cancels.get(0)).getMessage()); + cancels.get(0).getMessage()); } } @@ -165,14 +160,14 @@ public abstract class ResourceVariantTreeSubscriber extends Subscriber { monitor = Policy.monitorFor(monitor); try { monitor.beginTask(null, 100); - Set allChanges = new HashSet(); + Set<IResource> allChanges = new HashSet<>(); if (getResourceComparator().isThreeWay()) { IResource[] baseChanges = getBaseTree().refresh(new IResource[] {resource}, depth, Policy.subMonitorFor(monitor, 25)); allChanges.addAll(Arrays.asList(baseChanges)); } IResource[] remoteChanges = getRemoteTree().refresh(new IResource[] {resource}, depth, Policy.subMonitorFor(monitor, 75)); allChanges.addAll(Arrays.asList(remoteChanges)); - IResource[] changedResources = (IResource[]) allChanges.toArray(new IResource[allChanges.size()]); + IResource[] changedResources = allChanges.toArray(new IResource[allChanges.size()]); fireTeamResourceChange(SubscriberChangeEvent.asSyncChangedDeltas(this, changedResources)); return Status.OK_STATUS; } catch (TeamException e) { diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java index 0382fcfea..db7c714cf 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/ThreeWayResourceComparator.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 @@ -36,9 +36,7 @@ public class ThreeWayResourceComparator implements IResourceVariantComparator { this.synchronizer = synchronizer; } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.IResourceVariantComparator#compare(org.eclipse.core.resources.IResource, org.eclipse.team.core.variants.IResourceVariant) - */ + @Override public boolean compare(IResource local, IResourceVariant remote) { // First, ensure the resources are the same gender if ((local.getType() == IResource.FILE) == remote.isContainer()) { @@ -59,18 +57,14 @@ public class ThreeWayResourceComparator implements IResourceVariantComparator { } } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.IResourceVariantComparator#compare(org.eclipse.team.core.variants.IResourceVariant, org.eclipse.team.core.variants.IResourceVariant) - */ + @Override public boolean compare(IResourceVariant base, IResourceVariant remote) { byte[] bytes1 = getBytes(base); byte[] bytes2 = getBytes(remote); return equals(bytes1, bytes2); } - /* (non-Javadoc) - * @see org.eclipse.team.core.variants.IResourceVariantComparator#isThreeWay() - */ + @Override public boolean isThreeWay() { return true; } |