Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java
index 3c66105c2ed..17bc5530c25 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Andrew Gvozdev and others.
+ * Copyright (c) 2009, 2013 Andrew Gvozdev 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
@@ -12,7 +12,9 @@
package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
import java.util.ArrayList;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.cdt.core.AbstractExecutableExtensionBase;
import org.eclipse.cdt.core.CCorePlugin;
@@ -59,7 +61,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
languageSettings = getLanguageSettings(rcDescription);
}
- List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
+ Set<ICLanguageSettingEntry> set = new LinkedHashSet<ICLanguageSettingEntry>();
if (languageSettings != null) {
for (ICLanguageSetting langSetting : languageSettings) {
@@ -86,8 +88,8 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
String projectRootedPath = mngr.generateVariableExpression("workspace_loc", rc.getProject().getName()) + Path.SEPARATOR + pathStr; //$NON-NLS-1$
ICLanguageSettingEntry projectRootedEntry = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, projectRootedPath, projectRootedPath, null, entry.getFlags());
- if (! list.contains(projectRootedEntry)) {
- list.add(projectRootedEntry);
+ if (!set.contains(projectRootedEntry)) {
+ set.add(projectRootedEntry);
}
}
} catch (CdtVariableException e) {
@@ -97,8 +99,8 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
}
}
- if (! list.contains(entry)) {
- list.add(entry);
+ if (!set.contains(entry)) {
+ set.add(entry);
}
}
}
@@ -107,7 +109,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
}
}
}
- return LanguageSettingsStorage.getPooledList(list);
+ return LanguageSettingsStorage.getPooledList(new ArrayList<ICLanguageSettingEntry>(set));
}
/**

Back to the top