30
30
import java .util .HashSet ;
31
31
import java .util .LinkedHashSet ;
32
32
import java .util .List ;
33
- import java .util .ListIterator ;
34
33
import java .util .Map ;
35
34
import java .util .Map .Entry ;
36
35
import java .util .Random ;
61
60
import org .eclipse .cdt .core .language .settings .providers .LanguageSettingsManager ;
62
61
import org .eclipse .cdt .core .model .CoreModel ;
63
62
import org .eclipse .cdt .core .model .CoreModelUtil ;
64
- import org .eclipse .cdt .core .parser .IScannerInfo ;
65
- import org .eclipse .cdt .core .parser .IScannerInfoChangeListener ;
66
63
import org .eclipse .cdt .core .settings .model .ICConfigurationDescription ;
67
64
import org .eclipse .cdt .core .settings .model .ICMultiConfigDescription ;
68
65
import org .eclipse .cdt .core .settings .model .ICProjectDescription ;
72
69
import org .eclipse .cdt .core .settings .model .extension .CConfigurationData ;
73
70
import org .eclipse .cdt .managedbuilder .buildproperties .IBuildProperty ;
74
71
import org .eclipse .cdt .managedbuilder .buildproperties .IBuildPropertyManager ;
75
- import org .eclipse .cdt .managedbuilder .envvar .IEnvironmentBuildPathsChangeListener ;
76
72
import org .eclipse .cdt .managedbuilder .envvar .IEnvironmentVariableProvider ;
77
73
import org .eclipse .cdt .managedbuilder .internal .buildproperties .BuildPropertyManager ;
78
74
import org .eclipse .cdt .managedbuilder .internal .core .BooleanExpressionApplicabilityCalculator ;
@@ -251,14 +247,8 @@ public class ManagedBuildManager extends AbstractCExtension {
251
247
// This map has a lifecycle corresponding to the build definitions extension loading.
252
248
private static Map <IBuildObject , IManagedConfigElement > configElementMap ;
253
249
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 ;
258
250
// Random number for derived object model elements
259
251
private static Random randomNumber ;
260
- // Environment Build Paths Change Listener
261
- private static IEnvironmentBuildPathsChangeListener fEnvironmentBuildPathsChangeListener ;
262
252
263
253
private static HashMap <MatchKey <ToolChain >, List <ToolChain >> fSortedToolChains ;
264
254
private static HashMap <MatchKey <Tool >, List <Tool >> fSortedTools ;
@@ -274,16 +264,6 @@ private static interface ISorter {
274
264
void sort ();
275
265
}
276
266
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
-
287
267
/**
288
268
* @return the next random number as a positive integer.
289
269
*/
@@ -860,37 +840,6 @@ public static void initializePathEntries(IResourceConfiguration resConfig, IOpti
860
840
initializePathEntries (cfg , option );
861
841
}
862
842
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
-
894
843
/**
895
844
* Adds the version of the managed build system to the project
896
845
* specified in the argument.
@@ -964,8 +913,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
964
913
} else {
965
914
// Event handling Failed.
966
915
}
967
- // initializePathEntries(resConfig,retOpt);
968
- notifyListeners (resConfig , retOpt );
969
916
} catch (BuildException e ) {
970
917
return null ;
971
918
}
@@ -1030,8 +977,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
1030
977
} else {
1031
978
// Event handling Failed.
1032
979
}
1033
- // initializePathEntries(resConfig,retOpt);
1034
- notifyListeners (resConfig , retOpt );
1035
980
} catch (BuildException e ) {
1036
981
return null ;
1037
982
}
@@ -1096,8 +1041,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
1096
1041
} else {
1097
1042
// Event handling Failed.
1098
1043
}
1099
- // initializePathEntries(resConfig,retOpt);
1100
- notifyListeners (resConfig , retOpt );
1101
1044
} catch (BuildException e ) {
1102
1045
return null ;
1103
1046
}
@@ -1116,8 +1059,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
1116
1059
} else {
1117
1060
// Event handling Failed.
1118
1061
}
1119
- // initializePathEntries(resConfig,retOpt);
1120
- notifyListeners (resConfig , retOpt );
1121
1062
} catch (BuildException e ) {
1122
1063
return null ;
1123
1064
}
@@ -2959,16 +2900,6 @@ public static URL getURLInBuildDefinitions(DefaultManagedConfigElement element,
2959
2900
return null ;
2960
2901
}
2961
2902
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
-
2972
2903
private static Map <IBuildObject , IManagedConfigElement > getConfigElementMap () {
2973
2904
if (!projectTypesLoading )
2974
2905
throw new IllegalStateException ();
0 commit comments