3030import java .util .HashSet ;
3131import java .util .LinkedHashSet ;
3232import java .util .List ;
33- import java .util .ListIterator ;
3433import java .util .Map ;
3534import java .util .Map .Entry ;
3635import java .util .Random ;
6160import org .eclipse .cdt .core .language .settings .providers .LanguageSettingsManager ;
6261import org .eclipse .cdt .core .model .CoreModel ;
6362import org .eclipse .cdt .core .model .CoreModelUtil ;
64- import org .eclipse .cdt .core .parser .IScannerInfo ;
65- import org .eclipse .cdt .core .parser .IScannerInfoChangeListener ;
6663import org .eclipse .cdt .core .settings .model .ICConfigurationDescription ;
6764import org .eclipse .cdt .core .settings .model .ICMultiConfigDescription ;
6865import org .eclipse .cdt .core .settings .model .ICProjectDescription ;
7269import org .eclipse .cdt .core .settings .model .extension .CConfigurationData ;
7370import org .eclipse .cdt .managedbuilder .buildproperties .IBuildProperty ;
7471import org .eclipse .cdt .managedbuilder .buildproperties .IBuildPropertyManager ;
75- import org .eclipse .cdt .managedbuilder .envvar .IEnvironmentBuildPathsChangeListener ;
7672import org .eclipse .cdt .managedbuilder .envvar .IEnvironmentVariableProvider ;
7773import org .eclipse .cdt .managedbuilder .internal .buildproperties .BuildPropertyManager ;
7874import org .eclipse .cdt .managedbuilder .internal .core .BooleanExpressionApplicabilityCalculator ;
@@ -251,14 +247,8 @@ public class ManagedBuildManager extends AbstractCExtension {
251247 // This map has a lifecycle corresponding to the build definitions extension loading.
252248 private static Map <IBuildObject , IManagedConfigElement > configElementMap ;
253249
254- // private static List sortedToolChains;
255- // private static Map builtTypeToToolChainListMap;
256- // Listeners interested in build model changes
257- private static Map <IResource , List <IScannerInfoChangeListener >> buildModelListeners ;
258250 // Random number for derived object model elements
259251 private static Random randomNumber ;
260- // Environment Build Paths Change Listener
261- private static IEnvironmentBuildPathsChangeListener fEnvironmentBuildPathsChangeListener ;
262252
263253 private static HashMap <MatchKey <ToolChain >, List <ToolChain >> fSortedToolChains ;
264254 private static HashMap <MatchKey <Tool >, List <Tool >> fSortedTools ;
@@ -274,16 +264,6 @@ private static interface ISorter {
274264 void sort ();
275265 }
276266
277- static {
278- getEnvironmentVariableProvider ()
279- .subscribe (fEnvironmentBuildPathsChangeListener = (configuration , buildPathType ) -> {
280- // if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
281- // initializePathEntries(configuration,null);
282- // notifyListeners(configuration,null);
283- // }
284- });
285- }
286-
287267 /**
288268 * @return the next random number as a positive integer.
289269 */
@@ -860,37 +840,6 @@ public static void initializePathEntries(IResourceConfiguration resConfig, IOpti
860840 initializePathEntries (cfg , option );
861841 }
862842
863- private static void notifyListeners (IResourceInfo resConfig , IOption option ) {
864- // Continue if change is something that effect the scanreser
865- try {
866- if (resConfig .getParent ().isTemporary () || (option != null && option .getValueType () != IOption .INCLUDE_PATH
867- && option .getValueType () != IOption .PREPROCESSOR_SYMBOLS
868- && option .getValueType () != IOption .INCLUDE_FILES && option .getValueType () != IOption .LIBRARY_PATHS
869- && option .getValueType () != IOption .LIBRARY_FILES && option .getValueType () != IOption .MACRO_FILES
870- && option .getValueType () != IOption .UNDEF_INCLUDE_PATH
871- && option .getValueType () != IOption .UNDEF_PREPROCESSOR_SYMBOLS
872- && option .getValueType () != IOption .UNDEF_INCLUDE_FILES
873- && option .getValueType () != IOption .UNDEF_LIBRARY_PATHS
874- && option .getValueType () != IOption .UNDEF_LIBRARY_FILES
875- && option .getValueType () != IOption .UNDEF_MACRO_FILES && !option .isForScannerDiscovery ())) {
876- return ;
877- }
878- } catch (BuildException e ) {
879- return ;
880- }
881-
882- // Figure out if there is a listener for this change
883- IResource resource = resConfig .getParent ().getOwner ();
884- List <IScannerInfoChangeListener > listeners = getBuildModelListeners ().get (resource );
885- if (listeners == null ) {
886- return ;
887- }
888- ListIterator <IScannerInfoChangeListener > iter = listeners .listIterator ();
889- while (iter .hasNext ()) {
890- iter .next ().changeNotification (resource , (IScannerInfo ) getBuildInfo (resource ));
891- }
892- }
893-
894843 /**
895844 * Adds the version of the managed build system to the project
896845 * specified in the argument.
@@ -964,8 +913,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
964913 } else {
965914 // Event handling Failed.
966915 }
967- // initializePathEntries(resConfig,retOpt);
968- notifyListeners (resConfig , retOpt );
969916 } catch (BuildException e ) {
970917 return null ;
971918 }
@@ -1030,8 +977,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
1030977 } else {
1031978 // Event handling Failed.
1032979 }
1033- // initializePathEntries(resConfig,retOpt);
1034- notifyListeners (resConfig , retOpt );
1035980 } catch (BuildException e ) {
1036981 return null ;
1037982 }
@@ -1096,8 +1041,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
10961041 } else {
10971042 // Event handling Failed.
10981043 }
1099- // initializePathEntries(resConfig,retOpt);
1100- notifyListeners (resConfig , retOpt );
11011044 } catch (BuildException e ) {
11021045 return null ;
11031046 }
@@ -1116,8 +1059,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
11161059 } else {
11171060 // Event handling Failed.
11181061 }
1119- // initializePathEntries(resConfig,retOpt);
1120- notifyListeners (resConfig , retOpt );
11211062 } catch (BuildException e ) {
11221063 return null ;
11231064 }
@@ -2959,16 +2900,6 @@ public static URL getURLInBuildDefinitions(DefaultManagedConfigElement element,
29592900 return null ;
29602901 }
29612902
2962- /*
2963- * @return
2964- */
2965- private static Map <IResource , List <IScannerInfoChangeListener >> getBuildModelListeners () {
2966- if (buildModelListeners == null ) {
2967- buildModelListeners = new HashMap <>();
2968- }
2969- return buildModelListeners ;
2970- }
2971-
29722903 private static Map <IBuildObject , IManagedConfigElement > getConfigElementMap () {
29732904 if (!projectTypesLoading )
29742905 throw new IllegalStateException ();
0 commit comments