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/core/subscribers/SubscriberScopeManager.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/core/subscribers/SubscriberScopeManager.java')
-rw-r--r-- | bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberScopeManager.java | 32 |
1 files changed, 13 insertions, 19 deletions
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()])); } } |