mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 571309: Use java Collections instead of System.arraycopy
System.arraycopy is more error prone and subsequent commits will be modifying the array. This commit is to keep unrelated code separate. Change-Id: I2490318176da3e631a63974ffe5fa62da44a96ea
This commit is contained in:
parent
a028e22442
commit
55c2df3b03
2 changed files with 5 additions and 6 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
|
||||||
Bundle-Version: 9.2.0.qualifier
|
Bundle-Version: 9.2.100.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
|
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -58,16 +58,15 @@ public class HeadlessBuilderExternalSettingsProvider extends CExternalSettingPro
|
||||||
static void hookExternalSettingsProvider() {
|
static void hookExternalSettingsProvider() {
|
||||||
if (additionalSettings.isEmpty())
|
if (additionalSettings.isEmpty())
|
||||||
return;
|
return;
|
||||||
// Remove the external settings providers from all the hooked projects
|
// hook the external settings providers to all projects
|
||||||
for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
|
for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
|
||||||
ICProjectDescription desc = CCorePlugin.getDefault().getProjectDescription(project);
|
ICProjectDescription desc = CCorePlugin.getDefault().getProjectDescription(project);
|
||||||
if (desc == null)
|
if (desc == null)
|
||||||
continue;
|
continue;
|
||||||
for (ICConfigurationDescription cfg : desc.getConfigurations()) {
|
for (ICConfigurationDescription cfg : desc.getConfigurations()) {
|
||||||
String[] extSettingIds = cfg.getExternalSettingsProviderIds();
|
List<String> settingIds = new ArrayList<>(Arrays.asList(cfg.getExternalSettingsProviderIds()));
|
||||||
String[] newSettingIds = new String[extSettingIds.length + 1];
|
settingIds.add(ID);
|
||||||
System.arraycopy(extSettingIds, 0, newSettingIds, 0, extSettingIds.length);
|
String[] newSettingIds = settingIds.toArray(String[]::new);
|
||||||
newSettingIds[extSettingIds.length] = ID;
|
|
||||||
cfg.setExternalSettingsProviderIds(newSettingIds);
|
cfg.setExternalSettingsProviderIds(newSettingIds);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue