diff options
author | Sergey Prigogin | 2016-08-24 11:53:18 +0000 |
---|---|---|
committer | Sergey Prigogin | 2016-08-24 11:53:18 +0000 |
commit | 610d92f8ebc9c90b9edbd289596a1681a92f1913 (patch) | |
tree | d672742994b2a3b2dd6fbfc38ac287f01a3fe442 /bundles/org.eclipse.team.cvs.ui | |
parent | 197e7f029ecc8b5217ce226bac3b4379df49c115 (diff) | |
download | eclipse.platform.team-610d92f8ebc9c90b9edbd289596a1681a92f1913.tar.gz eclipse.platform.team-610d92f8ebc9c90b9edbd289596a1681a92f1913.tar.xz eclipse.platform.team-610d92f8ebc9c90b9edbd289596a1681a92f1913.zip |
Bug 491036 - Eliminate Utils.getAdapter(Object, Class) in favor of
Adapters.adapt
Change-Id: I710ccfa96a6e3c6c329a57197273d2db524f0098
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui')
5 files changed, 11 insertions, 15 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java index cfa509685..e567b17e9 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java @@ -1210,7 +1210,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC protected static ICVSFile getCVSFile(Object object) { // First, adapt to IResource and ensure mapped to CVS - IResource resource = (IResource)Utils.getAdapter(object, IResource.class); + IResource resource = (IResource)Adapters.adapt(object, IResource.class); if (resource instanceof IFile) { RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); if (provider instanceof CVSTeamProvider) @@ -1218,22 +1218,22 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC return null; } // Second, try ICVSFile - ICVSFile remoteFile = (ICVSFile)Utils.getAdapter(object, ICVSFile.class); + ICVSFile remoteFile = (ICVSFile)Adapters.adapt(object, ICVSFile.class); if (remoteFile != null) { return remoteFile; } // Next, try ICVSResource - ICVSResource remote = (ICVSResource)Utils.getAdapter(object, ICVSResource.class); + ICVSResource remote = (ICVSResource)Adapters.adapt(object, ICVSResource.class); if (remote instanceof RemoteFile) { return (ICVSFile)remote; } // Next, try IResourceVariant - IResourceVariant variant = (IResourceVariant)Utils.getAdapter(object, IResourceVariant.class); + IResourceVariant variant = (IResourceVariant)Adapters.adapt(object, IResourceVariant.class); if (variant instanceof RemoteFile) { return (ICVSFile)remote; } // Finally, try IFileRevision - IFileRevision revision = (IFileRevision)Utils.getAdapter(object, IFileRevision.class); + IFileRevision revision = (IFileRevision)Adapters.adapt(object, IFileRevision.class); if (revision instanceof CVSFileRevision) { return ((CVSFileRevision)revision).getCVSRemoteFile(); } @@ -1896,7 +1896,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC if (fileObject instanceof LocalFileRevision) { try { IStorage storage = ((LocalFileRevision) fileObject).getStorage(new NullProgressMonitor()); - if (Utils.getAdapter(storage, IFileState.class) != null) { + if (Adapters.adapt(storage, IFileState.class) != null) { //local revision label = NLS.bind(TeamUIMessages.CompareFileRevisionEditorInput_localRevision, new Object[]{element.getName(), ((FileRevisionTypedElement) element).getTimestamp()}); } 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 677e0690a..da8b1fff4 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 @@ -39,7 +39,6 @@ import org.eclipse.team.internal.ccvs.ui.subscriber.LogEntryCacheUpdateHandler; import org.eclipse.team.internal.ccvs.ui.subscriber.LogEntryCacheUpdateHandler.ILogsFetchedListener; import org.eclipse.team.internal.core.mapping.SyncInfoToDiffConverter; import org.eclipse.team.internal.core.subscribers.*; -import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup; @@ -405,7 +404,7 @@ public class CheckedInChangeSetCollector extends BatchingChangeSetManager implem } private SyncInfoToDiffConverter getConverter() { - SyncInfoToDiffConverter converter = (SyncInfoToDiffConverter)Utils.getAdapter(subscriber, SyncInfoToDiffConverter.class); + SyncInfoToDiffConverter converter = (SyncInfoToDiffConverter)Adapters.adapt(subscriber, SyncInfoToDiffConverter.class); if (converter == null) converter = SyncInfoToDiffConverter.getDefault(); return converter; 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 664ee810e..25ba22a07 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 @@ -92,7 +92,7 @@ public class MergeSubscriberContext extends CVSSubscriberMergeContext { IThreeWayDiff twd = (IThreeWayDiff) diff; if (twd.getKind() == IDiff.ADD && twd.getDirection() == IThreeWayDiff.INCOMING) { IFileRevision remote = Utils.getRemote(diff); - IResourceVariant variant = (IResourceVariant)Utils.getAdapter(remote, IResourceVariant.class); + IResourceVariant variant = (IResourceVariant)Adapters.adapt(remote, IResourceVariant.class); byte[] syncBytes = variant.asBytes(); MutableResourceSyncInfo info = new MutableResourceSyncInfo(resource.getName(), ResourceSyncInfo.ADDED_REVISION); info.setKeywordMode(ResourceSyncInfo.getKeywordMode(syncBytes)); 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 876f12dae..1e3c85bce 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 @@ -15,8 +15,7 @@ import java.util.List; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.mapping.ResourceMapping; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.*; import org.eclipse.osgi.util.NLS; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.diff.IDiff; @@ -32,7 +31,6 @@ import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener; import org.eclipse.team.internal.ccvs.core.resources.RemoteFile; import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; -import org.eclipse.team.internal.ui.Utils; import org.eclipse.ui.IWorkbenchPart; /** @@ -78,7 +76,7 @@ public abstract class CacheTreeContentsOperation extends SingleCommandOperation IResource local = getTree().getResource(node); IFileRevision remote = getRemoteFileState(twd); if (remote != null) { - IResourceVariant variant = (IResourceVariant)Utils.getAdapter(remote, IResourceVariant.class); + IResourceVariant variant = (IResourceVariant)Adapters.adapt(remote, IResourceVariant.class); if (local.getType() == IResource.FILE && isEnabledForDirection(twd.getDirection()) && variant instanceof RemoteFile) { 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 f57e20152..3e06812dc 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 @@ -193,8 +193,7 @@ public class CommitWizard extends ResizableWizard { private void getAllOutOfSync() throws CVSException { try { ISynchronizationContext context = getParticipant().getContext(); - SubscriberDiffTreeEventHandler handler = (SubscriberDiffTreeEventHandler) Utils - .getAdapter(context, SubscriberDiffTreeEventHandler.class); + SubscriberDiffTreeEventHandler handler = (SubscriberDiffTreeEventHandler) Adapters.adapt(context, SubscriberDiffTreeEventHandler.class); handler.initializeIfNeeded(); Job.getJobManager().join(context, null); } catch (InterruptedException e) { |