diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/helloworldC.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/helloworldC.zip index c5577598963..e5438fbd402 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/helloworldC.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/builderTests/regressions/helloworldC.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index 29a367f5f47..0b30d850a50 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -30,7 +30,6 @@ import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; -import java.util.ListIterator; import java.util.Map; import java.util.Map.Entry; import java.util.Random; @@ -61,8 +60,6 @@ import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModelUtil; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoChangeListener; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription; @@ -72,7 +69,6 @@ import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty; import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyManager; -import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentBuildPathsChangeListener; import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider; import org.eclipse.cdt.managedbuilder.internal.buildproperties.BuildPropertyManager; import org.eclipse.cdt.managedbuilder.internal.core.BooleanExpressionApplicabilityCalculator; @@ -251,14 +247,8 @@ public class ManagedBuildManager extends AbstractCExtension { // This map has a lifecycle corresponding to the build definitions extension loading. private static Map configElementMap; - // private static List sortedToolChains; - // private static Map builtTypeToToolChainListMap; - // Listeners interested in build model changes - private static Map> buildModelListeners; // Random number for derived object model elements private static Random randomNumber; - // Environment Build Paths Change Listener - private static IEnvironmentBuildPathsChangeListener fEnvironmentBuildPathsChangeListener; private static HashMap, List> fSortedToolChains; private static HashMap, List> fSortedTools; @@ -274,16 +264,6 @@ private static interface ISorter { void sort(); } - static { - getEnvironmentVariableProvider() - .subscribe(fEnvironmentBuildPathsChangeListener = (configuration, buildPathType) -> { - // if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){ - // initializePathEntries(configuration,null); - // notifyListeners(configuration,null); - // } - }); - } - /** * @return the next random number as a positive integer. */ @@ -820,47 +800,11 @@ public static IConfiguration getSelectedConfiguration(IProject project) { return null; } - /* (non-Javadoc) - * - * @param config - * @param option + /** + * Unreferenced in CDT + * @deprecated */ - /* - private static void notifyListeners(IConfiguration config, IOption option) { - // Continue if change is something that effect the scanner - try { - //an option can be null in the case of calling this method from the environment - //build path change listener - if (config.isTemporary() || - (option != null && option.getValueType() != IOption.INCLUDE_PATH - && option.getValueType() != IOption.PREPROCESSOR_SYMBOLS - && option.getValueType() != IOption.INCLUDE_FILES - && option.getValueType() != IOption.LIBRARY_PATHS - && option.getValueType() != IOption.LIBRARY_FILES - && option.getValueType() != IOption.MACRO_FILES - && option.getValueType() != IOption.UNDEF_INCLUDE_PATH - && option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS - && option.getValueType() != IOption.UNDEF_INCLUDE_FILES - && option.getValueType() != IOption.UNDEF_LIBRARY_PATHS - && option.getValueType() != IOption.UNDEF_LIBRARY_FILES - && option.getValueType() != IOption.UNDEF_MACRO_FILES - )) { - return; - } - } catch (BuildException e) {return;} - - // Figure out if there is a listener for this change - IResource resource = config.getOwner(); - List listeners = (List) getBuildModelListeners().get(resource); - if (listeners == null) { - return; - } - ListIterator iter = listeners.listIterator(); - while (iter.hasNext()) { - ((IScannerInfoChangeListener)iter.next()).changeNotification(resource, (IScannerInfo)getBuildInfo(resource)); - } - } - */ + @Deprecated(forRemoval = true) public static void initializePathEntries(IConfiguration config, IOption option) { try { if (config.isTemporary() || (option != null && option.getValueType() != IOption.INCLUDE_PATH @@ -885,43 +829,17 @@ public static void initializePathEntries(IConfiguration config, IOption option) } + /** + * Unreferenced in CDT + * @deprecated + */ + @Deprecated(forRemoval = true) public static void initializePathEntries(IResourceConfiguration resConfig, IOption option) { IConfiguration cfg = resConfig.getParent(); if (cfg != null) initializePathEntries(cfg, option); } - private static void notifyListeners(IResourceInfo resConfig, IOption option) { - // Continue if change is something that effect the scanreser - try { - if (resConfig.getParent().isTemporary() || (option != null && option.getValueType() != IOption.INCLUDE_PATH - && option.getValueType() != IOption.PREPROCESSOR_SYMBOLS - && option.getValueType() != IOption.INCLUDE_FILES && option.getValueType() != IOption.LIBRARY_PATHS - && option.getValueType() != IOption.LIBRARY_FILES && option.getValueType() != IOption.MACRO_FILES - && option.getValueType() != IOption.UNDEF_INCLUDE_PATH - && option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS - && option.getValueType() != IOption.UNDEF_INCLUDE_FILES - && option.getValueType() != IOption.UNDEF_LIBRARY_PATHS - && option.getValueType() != IOption.UNDEF_LIBRARY_FILES - && option.getValueType() != IOption.UNDEF_MACRO_FILES && !option.isForScannerDiscovery())) { - return; - } - } catch (BuildException e) { - return; - } - - // Figure out if there is a listener for this change - IResource resource = resConfig.getParent().getOwner(); - List listeners = getBuildModelListeners().get(resource); - if (listeners == null) { - return; - } - ListIterator iter = listeners.listIterator(); - while (iter.hasNext()) { - iter.next().changeNotification(resource, (IScannerInfo) getBuildInfo(resource)); - } - } - /** * Adds the version of the managed build system to the project * specified in the argument. @@ -995,8 +913,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I } else { // Event handling Failed. } - // initializePathEntries(resConfig,retOpt); - notifyListeners(resConfig, retOpt); } catch (BuildException e) { return null; } @@ -1061,8 +977,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I } else { // Event handling Failed. } - // initializePathEntries(resConfig,retOpt); - notifyListeners(resConfig, retOpt); } catch (BuildException e) { return null; } @@ -1127,8 +1041,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I } else { // Event handling Failed. } - // initializePathEntries(resConfig,retOpt); - notifyListeners(resConfig, retOpt); } catch (BuildException e) { return null; } @@ -1147,8 +1059,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I } else { // Event handling Failed. } - // initializePathEntries(resConfig,retOpt); - notifyListeners(resConfig, retOpt); } catch (BuildException e) { return null; } @@ -1478,6 +1388,11 @@ public static void updateCoreSettings(IProject project) throws CoreException { updateBuildInfo(project, true); } + /** + * Unreferenced in CDT + * @deprecated + */ + @Deprecated public static void updateCoreSettings(IConfiguration cfg) throws CoreException { IProject project = cfg.getOwner().getProject(); ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); @@ -1488,6 +1403,11 @@ public static void updateCoreSettings(IConfiguration cfg) throws CoreException { } } + /** + * Unreferenced in CDT + * @deprecated + */ + @Deprecated(forRemoval = true) public static void updateCoreSettings(IProject project, IConfiguration[] cfgs) throws CoreException { updateCoreSettings(project, cfgs, false); } @@ -2980,16 +2900,6 @@ public static URL getURLInBuildDefinitions(DefaultManagedConfigElement element, return null; } - /* - * @return - */ - private static Map> getBuildModelListeners() { - if (buildModelListeners == null) { - buildModelListeners = new HashMap<>(); - } - return buildModelListeners; - } - private static Map getConfigElementMap() { if (!projectTypesLoading) throw new IllegalStateException(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java index c1c0e11f16f..a8d150de206 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java @@ -20,7 +20,10 @@ * listeners of the environment build path changes should implement this interface * * @since 3.0 + * + * @deprecated Not referenced in CDT */ +@Deprecated(forRemoval = true) public interface IEnvironmentBuildPathsChangeListener { /** diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java index 1ce5e814a91..3d46b3e18da 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java @@ -123,11 +123,17 @@ public IBuildEnvironmentVariable getVariable(String variableName, Object level, * adds the listener that will return notifications about the include and library paths changes. * The ManagedBuildManager will register the change listener and will notify all registered * Scanned Info Change Listeners about the include paths change. + * + * @deprecated Not referenced in CDT */ + @Deprecated(forRemoval = true) void subscribe(IEnvironmentBuildPathsChangeListener listener); /** * removes the include and library paths change listener + * + * @deprecated Not referenced in CDT */ + @Deprecated(forRemoval = true) void unsubscribe(IEnvironmentBuildPathsChangeListener listener); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java index 0fee0afb75f..fbe790bbce7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java @@ -238,7 +238,10 @@ private List getListeners() { /** * notifies registered listeners + * + * @deprecated Not referenced in CDT */ + @Deprecated(forRemoval = true) private void notifyListeners(IConfiguration configuration, int buildPathType) { List listeners = getListeners(); for (IEnvironmentBuildPathsChangeListener listener : listeners) { @@ -246,6 +249,11 @@ private void notifyListeners(IConfiguration configuration, int buildPathType) { } } + /** + * + * @deprecated Not referenced in CDT + */ + @Deprecated(forRemoval = true) @Override public synchronized void subscribe(IEnvironmentBuildPathsChangeListener listener) { if (listener == null) @@ -257,6 +265,11 @@ public synchronized void subscribe(IEnvironmentBuildPathsChangeListener listener listeners.add(listener); } + /** + * + * @deprecated Not referenced in CDT + */ + @Deprecated(forRemoval = true) @Override public synchronized void unsubscribe(IEnvironmentBuildPathsChangeListener listener) { if (listener == null) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java index 3ec1a8ee8ca..d38d1333aeb 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java @@ -47,7 +47,7 @@ * @deprecated Since CDT 4.0 replaced by {@link ScannerInfoProviderProxy}. Still * used as a default for projects created by earlier CDT versions. */ -@Deprecated +@Deprecated(forRemoval = true) public class ScannerProvider extends AbstractCExtension implements IScannerInfoProvider, IElementChangedListener { // Listeners interested in build model changes