1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
This commit is contained in:
Andrew Gvozdev 2012-05-04 19:53:16 -04:00
parent 56f5df2f68
commit 2949c7da2f
12 changed files with 2615 additions and 2613 deletions

View file

@ -161,6 +161,7 @@ public class CfgScannerConfigUtil {
if (toolchain!=null) {
String toolchainProfileId = null;
if (toolchain instanceof ToolChain) {
// still allow a user a choice to select any legacy profiles
toolchainProfileId = ((ToolChain) toolchain).getLegacyScannerConfigDiscoveryProfileId();
} else {
toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();

View file

@ -47,7 +47,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
/** @since 8.1 */
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders"; //$NON-NLS-1$
public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$
public static final String PARENT = "parent"; //$NON-NLS-1$

View file

@ -54,7 +54,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
/** @since 8.1 */
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders"; //$NON-NLS-1$
/**
* Returns the configuration that is the parent of this tool-chain.

View file

@ -786,7 +786,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Get the semicolon separated list of IDs of the error parsers
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
// Get the initial/default language setttings providers IDs
// Get the initial/default language settings providers IDs
defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
// Get the artifact extension

View file

@ -1842,9 +1842,9 @@ public class InputType extends BuildObject implements IInputType {
}
/**
* Temporary method to support compatibility during SD transition.
* Check if legacy scanner discovery method should be used.
*/
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
private boolean isLegacyScannerDiscovery() {
boolean isLanguageSettingsProvidersEnabled = false;
ITool tool = getParent();
if (tool!=null) {
@ -1860,7 +1860,7 @@ public class InputType extends BuildObject implements IInputType {
}
}
}
return isLanguageSettingsProvidersEnabled;
return !isLanguageSettingsProvidersEnabled;
}
/**
@ -1879,18 +1879,20 @@ public class InputType extends BuildObject implements IInputType {
}
public String getDiscoveryProfileIdAttribute() {
if (!isLanguageSettingsProvidersFunctionalityEnabled())
if (isLegacyScannerDiscovery()) {
return getLegacyDiscoveryProfileIdAttribute();
}
return getDiscoveryProfileIdAttributeInternal();
}
/**
* Method extracted temporarily to support compatibility during SD transition.
* Do not inline! This method needs to call itself recursively.
*/
private String getDiscoveryProfileIdAttributeInternal() {
if(buildInfoDicsoveryProfileId == null && superClass instanceof InputType)
if (buildInfoDicsoveryProfileId == null && superClass instanceof InputType) {
return ((InputType)superClass).getDiscoveryProfileIdAttributeInternal();
}
return buildInfoDicsoveryProfileId;
}

View file

@ -442,7 +442,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public String[] getDefaultLanguageSettingsProviderIds() {
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode");
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode"); //$NON-NLS-1$
return null;
}

View file

@ -558,7 +558,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Get the target tool id
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL));
// Get the initial/default language setttings providers IDs
// Get the initial/default language settings providers IDs
defaultLanguageSettingsProviderIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
// Get the scanner config discovery profile id
@ -1545,9 +1545,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
/**
* Temporary method to support compatibility during SD transition.
* Check if legacy scanner discovery method should be used.
*/
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
private boolean isLegacyScannerDiscovery() {
boolean isLanguageSettingsProvidersEnabled = false;
IConfiguration cfg = getParent();
if (cfg != null) {
@ -1557,11 +1557,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
}
}
return isLanguageSettingsProvidersEnabled;
return !isLanguageSettingsProvidersEnabled;
}
/**
* Temporary method to support compatibility during SD transition.
* Get list of scanner discovery profiles supported by previous version.
* @see ScannerDiscoveryLegacySupport#getDeprecatedLegacyProfiles(String)
*
* @noreference This method is not intended to be referenced by clients.
@ -1580,21 +1580,17 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return profileId;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId()
*/
@Override
public String getScannerConfigDiscoveryProfileId() {
if (!isLanguageSettingsProvidersFunctionalityEnabled())
if (isLegacyScannerDiscovery()) {
return getLegacyScannerConfigDiscoveryProfileId();
}
return getScannerConfigDiscoveryProfileIdInternal();
}
/**
* Method extracted temporarily to support compatibility during SD transition.
* Do not inline! This method needs to call itself recursively.
*/
private String getScannerConfigDiscoveryProfileIdInternal() {
if (scannerConfigDiscoveryProfileId == null && superClass instanceof ToolChain) {

View file

@ -496,7 +496,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
@Override
public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription, IProgressMonitor monitor) throws CoreException {
public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription,
IProgressMonitor monitor)
throws CoreException {
if(cfgDescription.isPreferenceConfiguration())
return loadPreferences(cfgDescription);

View file

@ -263,18 +263,16 @@ public class CDTPrefUtil {
private static final Object[] getListForDisplay(Object[][] input, int mode, Comparator<Object> cmp) {
if (input == null || input.length == 0)
return EMPTY_ARRAY;
if (input.length == 1) {
return (input[0] == null) ?
EMPTY_ARRAY :
input[0];
return (input[0] == null) ? EMPTY_ARRAY : input[0];
}
Object[] s1 = input[0];
if (s1 == null ||
s1.length == 0)
if (s1 == null || s1.length == 0)
return EMPTY_ARRAY;
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
{
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION) {
ArrayList<Object> lst = new ArrayList<Object>();
for (int i=0; i<s1.length; i++) {
if (s1[i] == null)
@ -282,10 +280,12 @@ public class CDTPrefUtil {
boolean found = true;
for (int k = 1; k<input.length; k++) {
Object[] s2 = input[k];
if (s2 == null || s2.length == 0)
if (s2 == null || s2.length == 0) {
return EMPTY_ARRAY;
if (i == 0)
}
if (i == 0) {
Arrays.sort(s2, cmp);
}
if (Arrays.binarySearch(s2, s1[i], cmp) < 0) {
found = false;
break;
@ -299,12 +299,13 @@ public class CDTPrefUtil {
}
TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles
for (Object[] element : input) {
if (element == null ||
element.length == 0)
if (element == null || element.length == 0) {
continue;
for (Object element2 : element)
}
for (Object element2 : element) {
lst.add(element2);
}
}
s1 = lst.toArray();
Arrays.sort(s1, cmp);
return s1;