Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 439902 - SynchronizationScopeManager shouldn't activate all plugins contributing a model provider
Summary: SynchronizationScopeManager shouldn't activate all plugins contributing a mod...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-18 10:46 EDT by Laurent Goubet CLA
Modified: 2020-05-26 16:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Goubet CLA 2014-07-18 10:46:40 EDT
All contributors of the "org.eclipse.core.resources.modelProviders" extension point will be eagerly (and uselessly) activated through

org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.getMappings(IModelProviderDescriptor, ResourceTraversal[], ResourceMappingContext, IProgressMonitor)

This method properly retrieves the array of "matching" traversals for the model provider descriptor (according to their "enablement" value)... but doesn't check for the potential emptiness of this array before calling "descriptor.getModelProvider", which will activate the contributing plugin even if there isn't a reason to.

This is the same kind of issue that's been resolved in org.eclipse.team.internal.ui.mapping.ModelEnablementPreferencePage.getLabel(IModelProviderDescriptor) through bug 133604.

Basically,

ResourceTraversal[] matchingTraversals = descriptor.getMatchingTraversals(traversals);
return descriptor.getModelProvider().getMappings(matchingTraversals, context, monitor);

should be changed to

ResourceTraversal[] matchingTraversals = descriptor.getMatchingTraversals(traversals);
if (matchingTraversals.length > 0)
	return descriptor.getModelProvider().getMappings(matchingTraversals, context, monitor);
return new ResourceMapping[0];
Comment 1 Eclipse Genie CLA 2020-05-26 16:51:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.