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 3e918851c1b..fddf0931dcf 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 @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ @@ -56,7 +56,6 @@ import org.eclipse.cdt.core.model.IPathEntry; 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.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; @@ -144,7 +143,7 @@ import org.w3c.dom.ProcessingInstruction; /** * This is the main entry point for getting at the build information - * for the managed build system. + * for the managed build system. */ public class ManagedBuildManager extends AbstractCExtension { @@ -169,11 +168,11 @@ public class ManagedBuildManager extends AbstractCExtension { private static final String MANIFEST_ERROR_OPTION_VALUEHANDLER = "ManagedBuildManager.error.manifest.option.valuehandler"; //$NON-NLS-1$ private static final String MANIFEST_ERROR_READ_ONLY = "ManagedBuildManager.error.read_only"; //$NON-NLS-1$ private static final String MANIFEST_ERROR_WRITE_FAILED = "ManagedBuildManager.error.write_failed"; //$NON-NLS-1$ - + // Error ID's for OptionValidError() public static final int ERROR_CATEGORY = 0; public static final int ERROR_FILTER = 1; - + public static final String BUILD_TYPE_PROPERTY_ID = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$ public static final String BUILD_ARTEFACT_TYPE_PROPERTY_ID = "org.eclipse.cdt.build.core.buildArtefactType"; //$NON-NLS-1$ @@ -184,15 +183,15 @@ public class ManagedBuildManager extends AbstractCExtension { public static final String BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB = "org.eclipse.cdt.build.core.buildArtefactType.sharedLib"; //$NON-NLS-1$ public static final String CFG_DATA_PROVIDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".configurationDataProvider"; //$NON-NLS-1$ - + private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$ - + public static final String INTERNAL_BUILDER_ID = "org.eclipse.cdt.build.core.internal.builder"; //$NON-NLS-1$ - + private static final String os = Platform.getOS(); private static final String arch = Platform.getOSArch(); private static final String ALL = "all"; //$NON-NLS-1$ - + // This is the version of the manifest and project files private static final PluginVersionIdentifier buildInfoVersion = new PluginVersionIdentifier(4, 0, 0); private static final Version version = new Version(4, 0, 0); @@ -226,21 +225,21 @@ public class ManagedBuildManager extends AbstractCExtension { private static Map extensionOutputTypeMap; // Targets defined in the manifest files (CDT V2.0 object model) private static Map extensionTargetMap; - - + + // "Selected configuraton" elements defined in the manifest files. // These are configuration elements that map to objects in the internal // representation of the manifest files. For example, ListOptionValues // and enumeratedOptionValues are NOT included. // Note that these "configuration elements" are not related to the - // managed build system "configurations". + // managed build system "configurations". // From the PDE Guide: - // A configuration element, with its attributes and children, directly - // reflects the content and structure of the extension section within the + // A configuration element, with its attributes and children, directly + // reflects the content and structure of the extension section within the // declaring plug-in's manifest (plugin.xml) file. // 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 @@ -249,13 +248,13 @@ public class ManagedBuildManager extends AbstractCExtension { private static Random randomNumber; // Environment Build Paths Change Listener private static IEnvironmentBuildPathsChangeListener fEnvironmentBuildPathsChangeListener; - - private static HashMap fSortedToolChains; + + private static HashMap> fSortedToolChains; private static HashMap fSortedTools; private static HashMap fSortedBuilders; - + private static Map fInfoMap = new HashMap(); - + private static ISorter fToolChainSorter = new ISorter(){ public void sort() { resortToolChains(); @@ -271,12 +270,12 @@ public class ManagedBuildManager extends AbstractCExtension { resortBuilders(); } }; - + private static interface ISorter { void sort(); } - + static { getEnvironmentVariableProvider().subscribe( fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener(){ @@ -290,7 +289,7 @@ public class ManagedBuildManager extends AbstractCExtension { } /** * Returns the next random number. - * + * * @return int A positive integer */ public static int getRandomNumber() { @@ -305,11 +304,11 @@ public class ManagedBuildManager extends AbstractCExtension { } return i; } - + /** * Returns the list of project types that are defined by this project, - * projects referenced by this project, and by the extensions. - * + * projects referenced by this project, and by the extensions. + * * @return IProjectType[] */ public static IProjectType[] getDefinedProjectTypes() { @@ -330,24 +329,24 @@ public class ManagedBuildManager extends AbstractCExtension { size += definedTypes != null ? definedTypes.size() : 0; IProjectType[] types = new IProjectType[size]; - - if (size > 0) { + + if (size > 0) { int n = 0; - for (int i = 0; i < projectTypes.size(); ++i) - types[n++] = (IProjectType)projectTypes.get(i); - + for (int i = 0; i < projectTypes.size(); i++) + types[n++] = projectTypes.get(i); + if (definedTypes != null) - for (int i = 0; i < definedTypes.size(); ++i) + for (int i = 0; i < definedTypes.size(); i++) types[n++] = definedTypes.get(i); } - + return types; } - + /** * Returns the project type with the passed in ID - * - * @param String + * + * @param String * @return IProjectType */ public static IProjectType getProjectType(String id) { @@ -359,13 +358,13 @@ public class ManagedBuildManager extends AbstractCExtension { e.printStackTrace(); } - return (IProjectType)getExtensionProjectTypeMap().get(id); + return getExtensionProjectTypeMap().get(id); } - + public static Version getVersion(){ return version; } - + protected static Map getExtensionDepCalcMap() { try { loadExtensions(); @@ -376,10 +375,10 @@ public class ManagedBuildManager extends AbstractCExtension { } return depCalculatorsMap; } - + /* (non-Javadoc) * Safe accessor for the map of IDs to ProjectTypes - * + * * @return Map */ public static SortedMap getExtensionProjectTypeMap() { @@ -395,7 +394,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to Configurations - * + * * @return Map */ protected static Map getExtensionConfigurationMap() { @@ -407,7 +406,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to Resource Configurations - * + * * @return Map */ protected static Map getExtensionResourceConfigurationMap() { @@ -419,7 +418,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to ToolChains - * + * * @return Map */ public static SortedMap getExtensionToolChainMap() { @@ -445,10 +444,10 @@ public class ManagedBuildManager extends AbstractCExtension { } return (ToolChain[])extensionToolChainMap.values().toArray(new ToolChain[extensionToolChainMap.size()]); } - + /* (non-Javadoc) * Safe accessor for the map of IDs to Tools - * + * * @return Map */ public static SortedMap getExtensionToolMap() { @@ -461,7 +460,7 @@ public class ManagedBuildManager extends AbstractCExtension { } return extensionToolMap; } - + public static ITool[] getExtensionTools() { try { loadExtensions(); @@ -475,7 +474,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to TargetPlatforms - * + * * @return Map */ protected static Map getExtensionTargetPlatformMap() { @@ -487,7 +486,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to Builders - * + * * @return Map */ public static SortedMap getExtensionBuilderMap() { @@ -500,7 +499,7 @@ public class ManagedBuildManager extends AbstractCExtension { } return extensionBuilderMap; } - + public static IBuilder[] getExtensionBuilders() { try { loadExtensions(); @@ -514,7 +513,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to Options - * + * * @return Map */ protected static Map getExtensionOptionMap() { @@ -526,7 +525,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to Option Categories - * + * * @return Map */ protected static Map getExtensionOptionCategoryMap() { @@ -538,7 +537,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to InputTypes - * + * * @return Map */ protected static Map getExtensionInputTypeMap() { @@ -550,7 +549,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to OutputTypes - * + * * @return Map */ protected static Map getExtensionOutputTypeMap() { @@ -562,7 +561,7 @@ public class ManagedBuildManager extends AbstractCExtension { /* (non-Javadoc) * Safe accessor for the map of IDs to Targets (CDT V2.0 object model) - * + * * @return Map */ protected static Map getExtensionTargetMap() { @@ -575,13 +574,13 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the targets owned by this project. If none are owned, * an empty array is returned. - * + * * @param project * @return */ public static ITarget[] getTargets(IResource resource) { IManagedBuildInfo buildInfo = getBuildInfo(resource); - + if (buildInfo != null) { List targets = buildInfo.getTargets(); return targets.toArray(new ITarget[targets.size()]); @@ -592,7 +591,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the project type from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IProjectType */ @@ -605,13 +604,13 @@ public class ManagedBuildManager extends AbstractCExtension { e.printStackTrace(); } - return (IProjectType) getExtensionProjectTypeMap().get(id); + return getExtensionProjectTypeMap().get(id); } /** * Returns the configuration from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IConfiguration */ @@ -638,11 +637,11 @@ public class ManagedBuildManager extends AbstractCExtension { return (IConfiguration[]) getExtensionConfigurationMap().values().toArray(new Configuration[getExtensionConfigurationMap().size()]); } - + /** * Returns the resource configuration from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IResourceConfiguration */ @@ -661,7 +660,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the tool-chain from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IToolChain */ @@ -680,7 +679,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the tool from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return ITool */ @@ -693,13 +692,13 @@ public class ManagedBuildManager extends AbstractCExtension { e.printStackTrace(); } - return (ITool) getExtensionToolMap().get(id); + return getExtensionToolMap().get(id); } /** * Returns the target platform from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return ITargetPlatform */ @@ -718,7 +717,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the builder from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IBuilder */ @@ -733,7 +732,7 @@ public class ManagedBuildManager extends AbstractCExtension { return (IBuilder) getExtensionBuilderMap().get(id); } - + public static IBuilder getExtensionBuilder(IBuilder builder) { for(;builder != null && !builder.isExtensionElement(); builder = builder.getSuperClass()); return builder; @@ -743,7 +742,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the option from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IOption */ @@ -762,7 +761,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the InputType from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IInputType */ @@ -781,7 +780,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the OutputType from the manifest with the ID specified in the argument * or null. - * + * * @param id * @return IOutputType */ @@ -800,7 +799,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Returns the target from the manifest with the ID specified in the argument * or null - CDT V2.0 object model. - * + * * @param id * @return ITarget */ @@ -815,11 +814,11 @@ public class ManagedBuildManager extends AbstractCExtension { return (ITarget) getExtensionTargetMap().get(id); } - + /** - * Answers the result of a best-effort search to find a target with the + * Answers the result of a best-effort search to find a target with the * specified ID, or null if one is not found. - * + * * @param resource * @param id * @return @@ -842,7 +841,7 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Sets the default configuration for the project. Note that this will also * update the default target if needed. - * + * * @param project * @param newDefault */ @@ -850,17 +849,17 @@ public class ManagedBuildManager extends AbstractCExtension { if (project == null || newDefault == null) { return; } - // Set the default in build information for the project + // Set the default in build information for the project IManagedBuildInfo info = getBuildInfo(project); if (info != null) { info.setDefaultConfiguration(newDefault); } } - + /** * Sets the currently selected configuration. This is used while the project * property pages are displayed - * + * * @param project * @param target */ @@ -868,7 +867,7 @@ public class ManagedBuildManager extends AbstractCExtension { if (project == null) { return; } - // Set the default in build information for the project + // Set the default in build information for the project IManagedBuildInfo info = getBuildInfo(project); if (info != null) { info.setSelectedConfiguration(config); @@ -885,11 +884,11 @@ public class ManagedBuildManager extends AbstractCExtension { IBuilder builder = toolChain.getBuilder(); if(builder != null) return builder.getBuildFileGenerator(); - } + } // If no generator is defined, return the default GNU generator return new GnuMakefileGenerator(); } - + /** * load tool provider defined or default (if not found) command line generator special for selected tool * @param toolId - id selected id @@ -903,11 +902,11 @@ public class ManagedBuildManager extends AbstractCExtension { return ManagedCommandLineGenerator.getCommandLineGenerator(); } - /** - * Targets may have a scanner config discovery profile defined that knows - * how to discover built-in compiler defines and includes search paths. + /** + * Targets may have a scanner config discovery profile defined that knows + * how to discover built-in compiler defines and includes search paths. * Find the profile for the target specified. - * + * * @param string the unique id of the target to search for * @return scanner configuration discovery profile id */ @@ -915,11 +914,11 @@ public class ManagedBuildManager extends AbstractCExtension { IToolChain toolChain = config.getToolChain(); return toolChain.getScannerConfigDiscoveryProfileId(); } - + /** * Gets the currently selected target. This is used while the project * property pages are displayed - * + * * @param project * @return target */ @@ -927,16 +926,16 @@ public class ManagedBuildManager extends AbstractCExtension { if (project == null) { return null; } - // Set the default in build information for the project + // Set the default in build information for the project IManagedBuildInfo info = getBuildInfo(project); if (info != null) { return info.getSelectedConfiguration(); } return null; } - + /* (non-Javadoc) - * + * * @param config * @param option */ @@ -947,7 +946,7 @@ public class ManagedBuildManager extends AbstractCExtension { //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 != null && option.getValueType() != IOption.INCLUDE_PATH && option.getValueType() != IOption.PREPROCESSOR_SYMBOLS && option.getValueType() != IOption.INCLUDE_FILES && option.getValueType() != IOption.LIBRARY_PATHS @@ -963,7 +962,7 @@ public class ManagedBuildManager extends AbstractCExtension { 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); @@ -997,25 +996,25 @@ public class ManagedBuildManager extends AbstractCExtension { } catch (BuildException e){ return; } - + try { updateCoreSettings(config); } catch (CoreException e) { } - + } - + 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 != null && option.getValueType() != IOption.INCLUDE_PATH && option.getValueType() != IOption.PREPROCESSOR_SYMBOLS && option.getValueType() != IOption.INCLUDE_FILES && option.getValueType() != IOption.LIBRARY_PATHS @@ -1031,7 +1030,7 @@ public class ManagedBuildManager extends AbstractCExtension { return; } } catch (BuildException e) {return;} - + // Figure out if there is a listener for this change IResource resource = resConfig.getParent().getOwner(); List listeners = (List) getBuildModelListeners().get(resource); @@ -1045,28 +1044,28 @@ public class ManagedBuildManager extends AbstractCExtension { } /** - * Adds the version of the managed build system to the project + * Adds the version of the managed build system to the project * specified in the argument. - * + * * @param newProject the project to version */ public static void setNewProjectVersion(IProject newProject) { // Get the build info for the argument ManagedBuildInfo info = findBuildInfo(newProject, true); if(info != null) - info.setVersion(buildInfoVersion.toString()); + info.setVersion(buildInfoVersion.toString()); } /** * Set the boolean value for an option for a given config. - * + * * @param config The configuration the option belongs to. * @param holder The holder/parent of the option. * @param option The option to set the value for. * @param value The boolean that the option should contain after the change. - * + * * @return IOption The modified option. This can be the same option or a newly created option. - * + * * @since 3.0 - The type and name of the ITool tool parameter * has changed to IHoldsOptions holder. Client code * assuming ITool as type, will continue to work unchanged. @@ -1077,16 +1076,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Request a value change and set dirty if real change results retOpt = config.setOption(holder, option, value); if (retOpt.getValueHandler().handleValue( - config, - holder, + config, + holder, retOpt, - retOpt.getValueHandlerExtraArgument(), + retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) { // TODO : Event is handled successfully and returned true. // May need to do something here say log a message. } else { - // Event handling Failed. - } + // Event handling Failed. + } // initializePathEntries(config,retOpt); // notifyListeners(config, retOpt); } catch (BuildException e) { @@ -1097,14 +1096,14 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Set the boolean value for an option for a given config. - * + * * @param resConfig The resource configuration the option belongs to. * @param holder The holder/parent of the option. * @param option The option to set the value for. * @param value The boolean that the option should contain after the change. - * + * * @return IOption The modified option. This can be the same option or a newly created option. - * + * * @since 3.0 - The type and name of the ITool tool parameter * has changed to IHoldsOptions holder. Client code * assuming ITool as type, will continue to work unchanged. @@ -1115,16 +1114,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Request a value change and set dirty if real change results retOpt = resConfig.setOption(holder, option, value); if (retOpt != null && retOpt.getValueHandler().handleValue( - resConfig, - holder, + resConfig, + holder, retOpt, - retOpt.getValueHandlerExtraArgument(), + retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) { // TODO : Event is handled successfully and returned true. // May need to do something here say log a message. } else { - // Event handling Failed. - } + // Event handling Failed. + } // initializePathEntries(resConfig,retOpt); notifyListeners(resConfig, retOpt); } catch (BuildException e) { @@ -1134,14 +1133,14 @@ public class ManagedBuildManager extends AbstractCExtension { } /** * Set the string value for an option for a given config. - * + * * @param config The configuration the option belongs to. * @param holder The holder/parent of the option. * @param option The option to set the value for. * @param value The value that the option should contain after the change. - * + * * @return IOption The modified option. This can be the same option or a newly created option. - * + * * @since 3.0 - The type and name of the ITool tool parameter * has changed to IHoldsOptions holder. Client code * assuming ITool as type, will continue to work unchanged. @@ -1151,16 +1150,16 @@ public class ManagedBuildManager extends AbstractCExtension { try { retOpt = config.setOption(holder, option, value); if (retOpt.getValueHandler().handleValue( - config, - holder, + config, + holder, retOpt, - retOpt.getValueHandlerExtraArgument(), + retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) { // TODO : Event is handled successfully and returned true. // May need to do something here say log a message. } else { - // Event handling Failed. - } + // Event handling Failed. + } // initializePathEntries(config,retOpt); // notifyListeners(config, retOpt); } catch (BuildException e) { @@ -1168,17 +1167,17 @@ public class ManagedBuildManager extends AbstractCExtension { } return retOpt; } - + /** * Set the string value for an option for a given resource config. - * + * * @param resConfig The resource configuration the option belongs to. * @param holder The holder/parent of the option. * @param option The option to set the value for. * @param value The value that the option should contain after the change. - * + * * @return IOption The modified option. This can be the same option or a newly created option. - * + * * @since 3.0 - The type and name of the ITool tool parameter * has changed to IHoldsOptions holder. Client code * assuming ITool as type, will continue to work unchanged. @@ -1188,16 +1187,16 @@ public class ManagedBuildManager extends AbstractCExtension { try { retOpt = resConfig.setOption(holder, option, value); if (retOpt.getValueHandler().handleValue( - resConfig, - holder, + resConfig, + holder, retOpt, - retOpt.getValueHandlerExtraArgument(), + retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) { // TODO : Event is handled successfully and returned true. // May need to do something here say log a message. } else { - // Event handling Failed. - } + // Event handling Failed. + } // initializePathEntries(resConfig,retOpt); notifyListeners(resConfig, retOpt); } catch (BuildException e) { @@ -1207,14 +1206,14 @@ public class ManagedBuildManager extends AbstractCExtension { } /** * Set the string array value for an option for a given config. - * + * * @param config The configuration the option belongs to. * @param holder The holder/parent of the option. * @param option The option to set the value for. * @param value The values the option should contain after the change. - * + * * @return IOption The modified option. This can be the same option or a newly created option. - * + * * @since 3.0 - The type and name of the ITool tool parameter * has changed to IHoldsOptions holder. Client code * assuming ITool as type, will continue to work unchanged. @@ -1224,18 +1223,18 @@ public class ManagedBuildManager extends AbstractCExtension { try { retOpt = config.setOption(holder, option, value); if (retOpt.getValueHandler().handleValue( - config, - holder, + config, + holder, retOpt, - retOpt.getValueHandlerExtraArgument(), + retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) { // TODO : Event is handled successfully and returned true. // May need to do something here say log a message. } else { - // Event handling Failed. - } + // Event handling Failed. + } // initializePathEntries(config,retOpt); -// notifyListeners(config, retOpt); +// notifyListeners(config, retOpt); } catch (BuildException e) { return null; } @@ -1244,14 +1243,14 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Set the string array value for an option for a given resource config. - * + * * @param resConfig The resource configuration the option belongs to. * @param holder The holder/parent of the option. * @param option The option to set the value for. * @param value The values the option should contain after the change. - * + * * @return IOption The modified option. This can be the same option or a newly created option. - * + * * @since 3.0 - The type and name of the ITool tool parameter * has changed to IHoldsOptions holder. Client code * assuming ITool as type, will continue to work unchanged. @@ -1261,41 +1260,41 @@ public class ManagedBuildManager extends AbstractCExtension { try { retOpt = resConfig.setOption(holder, option, value); if (retOpt.getValueHandler().handleValue( - resConfig, - holder, + resConfig, + holder, retOpt, - retOpt.getValueHandlerExtraArgument(), + retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) { // TODO : Event is handled successfully and returned true. // May need to do something here say log a message. } else { - // Event handling Failed. - } + // Event handling Failed. + } // initializePathEntries(resConfig,retOpt); - notifyListeners(resConfig, retOpt); + notifyListeners(resConfig, retOpt); } catch (BuildException e) { return null; } return retOpt; } - + public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, IOption option, OptionStringValue[] value) { IOption retOpt; try { retOpt = resConfig.setOption(holder, option, value); if (retOpt.getValueHandler().handleValue( - resConfig, - holder, + resConfig, + holder, retOpt, - retOpt.getValueHandlerExtraArgument(), + retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) { // TODO : Event is handled successfully and returned true. // May need to do something here say log a message. } else { - // Event handling Failed. - } + // Event handling Failed. + } // initializePathEntries(resConfig,retOpt); - notifyListeners(resConfig, retOpt); + notifyListeners(resConfig, retOpt); } catch (BuildException e) { return null; } @@ -1333,12 +1332,12 @@ public class ManagedBuildManager extends AbstractCExtension { try { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.newDocument(); - + // Get the build information for the project ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project); // Save the build info - if (buildInfo != null && + if (buildInfo != null && !buildInfo.isReadOnly() && buildInfo.isValid() && (force == true || buildInfo.isDirty())) { @@ -1348,10 +1347,10 @@ public class ManagedBuildManager extends AbstractCExtension { ProcessingInstruction instruction = doc.createProcessingInstruction(VERSION_ELEMENT_NAME, projectVersion); doc.appendChild(instruction); } - Element rootElement = doc.createElement(ROOT_NODE_NAME); + Element rootElement = doc.createElement(ROOT_NODE_NAME); doc.appendChild(rootElement); buildInfo.serializeLegacy(doc, rootElement); - + // Transform the document to something we can save in a file ByteArrayOutputStream stream = new ByteArrayOutputStream(); Transformer transformer = TransformerFactory.newInstance().newTransformer(); @@ -1361,13 +1360,13 @@ public class ManagedBuildManager extends AbstractCExtension { DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(stream); transformer.transform(source, result); - + // Save the document IFile projectFile = project.getFile(SETTINGS_FILE_NAME); String utfString = stream.toString("UTF-8"); //$NON-NLS-1$ if (projectFile.exists()) { - if (projectFile.isReadOnly()) { + if (projectFile.isReadOnly()) { // If we are not running headless, and there is a UI Window around, grab it // and the associated shell IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); @@ -1375,10 +1374,10 @@ public class ManagedBuildManager extends AbstractCExtension { IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); window = windows[0]; } - Shell shell = null; - if (window != null) { + Shell shell = null; + if (window != null) { shell = window.getShell(); - } + } // Inform Eclipse that we are intending to modify this file // This will provide the user the opportunity, via UI prompts, to fetch the file from source code control // reset a read-only file protection to write etc. @@ -1389,10 +1388,10 @@ public class ManagedBuildManager extends AbstractCExtension { // For other non-successful status, we take our chances, attempt the write, and pass // along any exception thrown if (!status.isOK()) { - if (status.getCode() == IResourceStatus.READ_ONLY_LOCAL) { - stream.close(); - throw new IOException(ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_READ_ONLY, projectFile.getFullPath().toString())); //$NON-NLS-1$ - } + if (status.getCode() == IResourceStatus.READ_ONLY_LOCAL) { + stream.close(); + throw new IOException(ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_READ_ONLY, projectFile.getFullPath().toString())); + } } } projectFile.setContents(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, new NullProgressMonitor()); //$NON-NLS-1$ @@ -1421,8 +1420,8 @@ public class ManagedBuildManager extends AbstractCExtension { err = e; } - if (err != null) { - // Put out an error message indicating that the attempted write to the .cdtbuild project file failed + if (err != null) { + // Put out an error message indicating that the attempted write to the .cdtbuild project file failed IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) { IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); @@ -1431,12 +1430,12 @@ public class ManagedBuildManager extends AbstractCExtension { final Shell shell = window.getShell(); if (shell != null) { - final String exceptionMsg = err.getMessage(); + final String exceptionMsg = err.getMessage(); shell.getDisplay().syncExec( new Runnable() { public void run() { - MessageDialog.openError(shell, + MessageDialog.openError(shell, ManagedMakeMessages.getResourceString("ManagedBuildManager.error.write_failed_title"), //$NON-NLS-1$ - ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_WRITE_FAILED, //$NON-NLS-1$ + ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_WRITE_FAILED, exceptionMsg)); } } ); @@ -1444,7 +1443,7 @@ public class ManagedBuildManager extends AbstractCExtension { } // If we return an honest status when the operation fails, there are instances when the UI behavior // is not very good - // Specifically, if "OK" is clicked by the user from the property page UI, and the return status + // Specifically, if "OK" is clicked by the user from the property page UI, and the return status // from this routine is false, the property page UI will not be closed (note: this is Eclispe code) and // the OK button will simply be grayed out // At this point, the only way out is to click "Cancel" to get the UI to go away; note however that any @@ -1461,7 +1460,8 @@ public class ManagedBuildManager extends AbstractCExtension { if(cause instanceof IllegalArgumentException){ //can not acquire the root rule Job j = new Job("save build info job"){ //$NON-NLS-1$ - + + @Override protected IStatus run(IProgressMonitor monitor) { try { updateBuildInfo(project, force); @@ -1470,7 +1470,7 @@ public class ManagedBuildManager extends AbstractCExtension { } return Status.OK_STATUS; } - + }; j.setRule(ResourcesPlugin.getWorkspace().getRoot()); j.setSystem(true); @@ -1485,9 +1485,9 @@ public class ManagedBuildManager extends AbstractCExtension { /** * Saves the build information associated with a project and all resources * in the project to the build info file. - * + * * @param project - * @param force + * @param force */ private static boolean updateBuildInfo(IProject project, boolean force) throws CoreException { IManagedBuildInfo info = getBuildInfo(project, false); @@ -1509,12 +1509,12 @@ public class ManagedBuildManager extends AbstractCExtension { try { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.newDocument(); - + // Get the build information for the project ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project); // Save the build info - if (buildInfo != null && + if (buildInfo != null && !buildInfo.isReadOnly() && buildInfo.isValid() && (force == true || buildInfo.isDirty())) { @@ -1524,10 +1524,10 @@ public class ManagedBuildManager extends AbstractCExtension { ProcessingInstruction instruction = doc.createProcessingInstruction(VERSION_ELEMENT_NAME, projectVersion); doc.appendChild(instruction); } - Element rootElement = doc.createElement(ROOT_NODE_NAME); + Element rootElement = doc.createElement(ROOT_NODE_NAME); doc.appendChild(rootElement); buildInfo.serialize(doc, rootElement); - + // Transform the document to something we can save in a file ByteArrayOutputStream stream = new ByteArrayOutputStream(); Transformer transformer = TransformerFactory.newInstance().newTransformer(); @@ -1537,13 +1537,13 @@ public class ManagedBuildManager extends AbstractCExtension { DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(stream); transformer.transform(source, result); - + // Save the document IFile projectFile = project.getFile(SETTINGS_FILE_NAME); String utfString = stream.toString("UTF-8"); //$NON-NLS-1$ if (projectFile.exists()) { - if (projectFile.isReadOnly()) { + if (projectFile.isReadOnly()) { // If we are not running headless, and there is a UI Window around, grab it // and the associated shell IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); @@ -1551,10 +1551,10 @@ public class ManagedBuildManager extends AbstractCExtension { IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); window = windows[0]; } - Shell shell = null; - if (window != null) { + Shell shell = null; + if (window != null) { shell = window.getShell(); - } + } // Inform Eclipse that we are intending to modify this file // This will provide the user the opportunity, via UI prompts, to fetch the file from source code control // reset a read-only file protection to write etc. @@ -1567,7 +1567,7 @@ public class ManagedBuildManager extends AbstractCExtension { if (!status.isOK()) { if (status.getCode() == IResourceStatus.READ_ONLY_LOCAL) { stream.close(); - throw new IOException(ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_READ_ONLY, projectFile.getFullPath().toString())); //$NON-NLS-1$ + throw new IOException(ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_READ_ONLY, projectFile.getFullPath().toString())); //$NON-NLS-1$ } } } @@ -1597,8 +1597,8 @@ public class ManagedBuildManager extends AbstractCExtension { err = e; } - if (err != null) { - // Put out an error message indicating that the attempted write to the .cdtbuild project file failed + if (err != null) { + // Put out an error message indicating that the attempted write to the .cdtbuild project file failed IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) { IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); @@ -1607,10 +1607,10 @@ public class ManagedBuildManager extends AbstractCExtension { final Shell shell = window.getShell(); if (shell != null) { - final String exceptionMsg = err.getMessage(); + final String exceptionMsg = err.getMessage(); shell.getDisplay().syncExec( new Runnable() { public void run() { - MessageDialog.openError(shell, + MessageDialog.openError(shell, ManagedMakeMessages.getResourceString("ManagedBuildManager.error.write_failed_title"), //$NON-NLS-1$ ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_WRITE_FAILED, //$NON-NLS-1$ exceptionMsg)); @@ -1620,7 +1620,7 @@ public class ManagedBuildManager extends AbstractCExtension { } // If we return an honest status when the operation fails, there are instances when the UI behavior // is not very good - // Specifically, if "OK" is clicked by the user from the property page UI, and the return status + // Specifically, if "OK" is clicked by the user from the property page UI, and the return status // from this routine is false, the property page UI will not be closed (note: this is Eclispe code) and // the OK button will simply be grayed out // At this point, the only way out is to click "Cancel" to get the UI to go away; note however that any @@ -1629,11 +1629,11 @@ public class ManagedBuildManager extends AbstractCExtension { return true; */ } - + public static void updateCoreSettings(IProject project) throws CoreException { updateBuildInfo(project, true); } - + public static void updateCoreSettings(IConfiguration cfg) throws CoreException{ IProject project = cfg.getOwner().getProject(); ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); @@ -1646,22 +1646,22 @@ public class ManagedBuildManager extends AbstractCExtension { public static void updateCoreSettings(IProject project, IConfiguration[] cfgs) throws CoreException{ updateCoreSettings(project, cfgs, false); } - + public static void updateCoreSettings(IProject project, IConfiguration[] cfgs, boolean avoidSerialization) throws CoreException{ if(cfgs == null){ IManagedBuildInfo info = getBuildInfo(project); if(info != null && info.isValid() && info.getManagedProject() != null) - cfgs = info.getManagedProject().getConfigurations(); + cfgs = info.getManagedProject().getConfigurations(); } - + if(cfgs == null || cfgs.length == 0) return; - + ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); boolean updated = false; if(projDes != null){ - for(int i = 0; i < cfgs.length; i++){ - if(BuildSettingsUtil.applyConfiguration(cfgs[i], projDes, true)){ + for (IConfiguration cfg : cfgs) { + if(BuildSettingsUtil.applyConfiguration(cfg, projDes, true)){ updated = true; } } @@ -1669,8 +1669,8 @@ public class ManagedBuildManager extends AbstractCExtension { BuildSettingsUtil.checkApplyDescription(project, projDes, avoidSerialization); } } - } - + } + /** * @param resource */ @@ -1680,12 +1680,12 @@ public class ManagedBuildManager extends AbstractCExtension { if(info != null){ IConfiguration[] configs = info.getManagedProject().getConfigurations(); // Send an event to each configuration and if they exist, its resource configurations - for (int i=0; i < configs.length; ++i) { + for (int i=0; i < configs.length; i++) { ManagedBuildManager.performValueHandlerEvent(configs[i], IManagedOptionValueHandler.EVENT_CLOSE); } info.setValid(false); - + try { resource.setSessionProperty(buildInfoProperty, null); } catch (CoreException e) { @@ -1695,9 +1695,9 @@ public class ManagedBuildManager extends AbstractCExtension { } /** - * Resets the build information for the project and configuration specified in the arguments. - * The build information will contain the settings defined in the plugin manifest. - * + * Resets the build information for the project and configuration specified in the arguments. + * The build information will contain the settings defined in the plugin manifest. + * * @param project * @param configuration */ @@ -1707,12 +1707,12 @@ public class ManagedBuildManager extends AbstractCExtension { IConfiguration[] cfs = (IConfiguration[])((MultiConfiguration)configuration).getItems(); for (IConfiguration c : cfs) { ((Configuration)c).reset(); - performValueHandlerEvent(c, + performValueHandlerEvent(c, IManagedOptionValueHandler.EVENT_SETDEFAULT, false); } } else { ((Configuration)configuration).reset(); - performValueHandlerEvent(configuration, + performValueHandlerEvent(configuration, IManagedOptionValueHandler.EVENT_SETDEFAULT, false); } } @@ -1720,29 +1720,29 @@ public class ManagedBuildManager extends AbstractCExtension { public static void resetResourceConfiguration(IProject project, IResourceConfiguration resConfig) { // reset the configuration ((ResourceConfiguration) resConfig).reset(); - - performValueHandlerEvent(resConfig, + + performValueHandlerEvent(resConfig, IManagedOptionValueHandler.EVENT_SETDEFAULT); } - + public static void resetOptionSettings(IResourceInfo rcInfo){ if(rcInfo instanceof IFileInfo){ IConfiguration c = rcInfo.getParent(); Configuration cfg = null; - IProject project = null; - if (c instanceof Configuration) + IProject project = null; + if (c instanceof Configuration) cfg = (Configuration)c; else if (c instanceof MultiConfiguration) { MultiConfiguration mc = (MultiConfiguration)c; IConfiguration[] cfs = (IConfiguration[])mc.getItems(); - cfg = (Configuration)cfs[0]; + cfg = (Configuration)cfs[0]; } if(cfg.isExtensionElement() || cfg.isPreference()) project = null; else project = cfg.getOwner().getProject(); - + if (rcInfo instanceof MultiResourceInfo) { for (IResourceInfo ri : (IResourceInfo[])((MultiResourceInfo)rcInfo).getItems()) resetResourceConfiguration(project, (IFileInfo)ri); @@ -1759,33 +1759,33 @@ public class ManagedBuildManager extends AbstractCExtension { } } /** - * Adds a ProjectType that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a ProjectType that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param projectType + * + * @param projectType */ public static void addExtensionProjectType(ProjectType projectType) { if (projectTypes == null) { projectTypes = new ArrayList(); } - + projectTypes.add(projectType); Object previous = getExtensionProjectTypeMap().put(projectType.getId(), projectType); if (previous != null) { // Report error ManagedBuildManager.outputDuplicateIdError( "ProjectType", //$NON-NLS-1$ - projectType.getId()); + projectType.getId()); } } - + /** - * Adds a Configuration that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a Configuration that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param configuration + * + * @param configuration */ public static void addExtensionConfiguration(Configuration configuration) { Object previous = getExtensionConfigurationMap().put(configuration.getId(), configuration); @@ -1793,16 +1793,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "Configuration", //$NON-NLS-1$ - configuration.getId()); + configuration.getId()); } } - + /** - * Adds a Resource Configuration that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a Resource Configuration that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param resourceConfiguration + * + * @param resourceConfiguration */ public static void addExtensionResourceConfiguration(ResourceConfiguration resourceConfiguration) { Object previous = getExtensionResourceConfigurationMap().put(resourceConfiguration.getId(), resourceConfiguration); @@ -1810,16 +1810,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "ResourceConfiguration", //$NON-NLS-1$ - resourceConfiguration.getId()); + resourceConfiguration.getId()); } } - + /** - * Adds a ToolChain that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a ToolChain that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param toolChain + * + * @param toolChain */ public static void addExtensionToolChain(ToolChain toolChain) { Object previous = getExtensionToolChainMap().put(toolChain.getId(), toolChain); @@ -1827,17 +1827,17 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "ToolChain", //$NON-NLS-1$ - toolChain.getId()); + toolChain.getId()); } } - + /** - * Adds a tool that is is specified in the manifest to the - * build system. This tool is available to any target that - * has a reference to it as part of its description. This - * permits a tool that is common to many targets to be defined - * only once. - * + * Adds a tool that is is specified in the manifest to the + * build system. This tool is available to any target that + * has a reference to it as part of its description. This + * permits a tool that is common to many targets to be defined + * only once. + * * @param tool */ public static void addExtensionTool(Tool tool) { @@ -1846,16 +1846,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "Tool", //$NON-NLS-1$ - tool.getId()); + tool.getId()); } } - + /** - * Adds a TargetPlatform that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a TargetPlatform that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param targetPlatform + * + * @param targetPlatform */ public static void addExtensionTargetPlatform(TargetPlatform targetPlatform) { Object previous = getExtensionTargetPlatformMap().put(targetPlatform.getId(), targetPlatform); @@ -1863,16 +1863,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "TargetPlatform", //$NON-NLS-1$ - targetPlatform.getId()); + targetPlatform.getId()); } } - + /** - * Adds a Builder that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a Builder that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param Builder + * + * @param Builder */ public static void addExtensionBuilder(Builder builder) { Object previous = getExtensionBuilderMap().put(builder.getId(), builder); @@ -1880,16 +1880,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "Builder", //$NON-NLS-1$ - builder.getId()); + builder.getId()); } } - + /** - * Adds a Option that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a Option that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param option + * + * @param option */ public static void addExtensionOption(Option option) { Object previous = getExtensionOptionMap().put(option.getId(), option); @@ -1897,16 +1897,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "Option", //$NON-NLS-1$ - option.getId()); + option.getId()); } } - + /** - * Adds a OptionCategory that is is specified in the manifest to the - * build system. It is available to any element that + * Adds a OptionCategory that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param optionCategory + * + * @param optionCategory */ public static void addExtensionOptionCategory(OptionCategory optionCategory) { Object previous = getExtensionOptionCategoryMap().put(optionCategory.getId(), optionCategory); @@ -1914,16 +1914,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "OptionCategory", //$NON-NLS-1$ - optionCategory.getId()); + optionCategory.getId()); } } - + /** - * Adds an InputType that is is specified in the manifest to the - * build system. It is available to any element that + * Adds an InputType that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param inputType + * + * @param inputType */ public static void addExtensionInputType(InputType inputType) { Object previous = getExtensionInputTypeMap().put(inputType.getId(), inputType); @@ -1931,16 +1931,16 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "InputType", //$NON-NLS-1$ - inputType.getId()); + inputType.getId()); } } - + /** - * Adds an OutputType that is is specified in the manifest to the - * build system. It is available to any element that + * Adds an OutputType that is is specified in the manifest to the + * build system. It is available to any element that * has a reference to it as part of its description. - * - * @param outputType + * + * @param outputType */ public static void addExtensionOutputType(OutputType outputType) { Object previous = getExtensionOutputTypeMap().put(outputType.getId(), outputType); @@ -1948,24 +1948,24 @@ public class ManagedBuildManager extends AbstractCExtension { // Report error ManagedBuildManager.outputDuplicateIdError( "OutputType", //$NON-NLS-1$ - outputType.getId()); + outputType.getId()); } } - + /** - * Adds a Target that is is specified in the manifest to the - * build system. It is available to any CDT 2.0 object model element that + * Adds a Target that is is specified in the manifest to the + * build system. It is available to any CDT 2.0 object model element that * has a reference to it as part of its description. - * + * * @param target */ public static void addExtensionTarget(Target target) { getExtensionTargetMap().put(target.getId(), target); } - + /** * Creates a new project instance for the resource based on the parent project type. - * + * * @param resource * @param parentTarget * @return new ITarget with settings based on the parent passed in the arguments @@ -1976,10 +1976,10 @@ public class ManagedBuildManager extends AbstractCExtension { { return new ManagedProject(resource, parent); } - + /** * Creates a new target for the resource based on the parentTarget. - * + * * @param resource * @param parentTarget * @return new ITarget with settings based on the parent passed in the arguments @@ -1989,11 +1989,11 @@ public class ManagedBuildManager extends AbstractCExtension { throws BuildException { IResource owner = parentTarget.getOwner(); - + if (owner != null && owner.equals(resource)) // Already added - return parentTarget; - + return parentTarget; + if (resource instanceof IProject) { // Must be an extension target if (owner != null) @@ -2005,11 +2005,11 @@ public class ManagedBuildManager extends AbstractCExtension { if (!owner.equals(resource.getProject())) throw new BuildException(ManagedMakeMessages.getResourceString("ManagedBuildManager.error.owner_not_project")); //$NON-NLS-1$ } - + // Passed validation so create the target. return new Target(resource, parentTarget); } - + /** * @param resource * @return @@ -2024,36 +2024,36 @@ public class ManagedBuildManager extends AbstractCExtension { buildInfo = findBuildInfo(resource.getProject(), true); initBuildInfoContainer(buildInfo); } catch (CoreException e) { - return new Status(IStatus.ERROR, - ManagedBuilderCorePlugin.getUniqueIdentifier(), - IStatus.ERROR, - e.getLocalizedMessage(), + return new Status(IStatus.ERROR, + ManagedBuilderCorePlugin.getUniqueIdentifier(), + IStatus.ERROR, + e.getLocalizedMessage(), e); } - return new Status(IStatus.OK, - ManagedBuilderCorePlugin.getUniqueIdentifier(), - IStatus.OK, - ManagedMakeMessages.getFormattedString("ManagedBuildInfo.message.init.ok", resource.getName()), //$NON-NLS-1$ + return new Status(IStatus.OK, + ManagedBuilderCorePlugin.getUniqueIdentifier(), + IStatus.OK, + ManagedMakeMessages.getFormattedString("ManagedBuildInfo.message.init.ok", resource.getName()), //$NON-NLS-1$ null); */ } - + /* (non-Javadoc) - * Private helper method to intialize the path entry container once and + * Private helper method to intialize the path entry container once and * only once when the build info is first loaded or created. - * + * * @param info * @throws CoreException */ private static void initBuildInfoContainer(ManagedBuildInfo info) throws CoreException { if (info == null) { - throw new CoreException(new Status(IStatus.ERROR, - ManagedBuilderCorePlugin.getUniqueIdentifier(), - IStatus.ERROR, - new String(), + throw new CoreException(new Status(IStatus.ERROR, + ManagedBuilderCorePlugin.getUniqueIdentifier(), + IStatus.ERROR, + new String(), null)); } - + if (info.isContainerInited()) return; // Now associate the path entry container with the project ICProject cProject = info.getCProject(); @@ -2070,36 +2070,35 @@ public class ManagedBuildManager extends AbstractCExtension { cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), new NullProgressMonitor()); } info.setContainerInited(true); - + } // end synchronized } - + private static boolean isVersionCompatible(IExtension extension) { // We can ignore the qualifier PluginVersionIdentifier version = null; // Get the version of the manifest IConfigurationElement[] elements = extension.getConfigurationElements(); - + // Find the version string in the manifest - for (int index = 0; index < elements.length; ++index) { - IConfigurationElement element = elements[index]; + for (IConfigurationElement element : elements) { if (element.getName().equals(REVISION_ELEMENT_NAME)) { version = new PluginVersionIdentifier(element.getAttribute(VERSION_ELEMENT_NAME)); break; } } - + if (version == null) { // This is a 1.2 manifest and we are compatible for now return true; } return(buildInfoVersion.isGreaterOrEqualTo(version)); } - + /* (non-Javadoc) * Determine if the .cdtbuild file is present, which will determine if build information - * can be loaded externally or not. Return true if present, false otherwise. + * can be loaded externally or not. Return true if present, false otherwise. */ private static boolean canLoadBuildInfo(final IProject project) { IFile file = project.getFile(SETTINGS_FILE_NAME); @@ -2121,17 +2120,17 @@ public class ManagedBuildManager extends AbstractCExtension { // If we cannot find the .cdtbuild project file, throw an exception and let the user know throw new BuildException(ManagedMakeMessages.getFormattedString(PROJECT_FILE_ERROR, project.getName())); } - + // So there is a project file, load the information there InputStream stream = new FileInputStream(cdtbuild); try { DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document document = parser.parse(stream); String fileVersion = null; - + // Get the first element in the project file Node rootElement = document.getFirstChild(); - + // Since 2.0 this will be a processing instruction containing version if (rootElement.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE) { // This is a 1.2 project and it must be updated @@ -2142,22 +2141,22 @@ public class ManagedBuildManager extends AbstractCExtension { if (buildInfoVersion.isGreaterThan(version)) { // This is >= 2.0 project, but earlier than the current MBS version - it may need to be updated } else { - // This is a + // This is a // isCompatibleWith will return FALSE, if: // o The major versions are not equal // o The major versions are equal, but the remainder of the .cdtbuild version # is // greater than the MBS version # if (!buildInfoVersion.isCompatibleWith(version)) { - throw new BuildException(ManagedMakeMessages.getFormattedString(PROJECT_VERSION_ERROR, project.getName())); + throw new BuildException(ManagedMakeMessages.getFormattedString(PROJECT_VERSION_ERROR, project.getName())); } } } - + // Now get the project root element (there should be only one) NodeList nodes = document.getElementsByTagName(ROOT_NODE_NAME); if (nodes.getLength() > 0) { Node node = nodes.item(0); - + // Create the internal representation of the project's MBS information buildInfo = new ManagedBuildInfo(project, XmlStorageUtil.createCStorageTree((Element)node), true, fileVersion); if (fileVersion != null) { @@ -2166,7 +2165,7 @@ public class ManagedBuildManager extends AbstractCExtension { PluginVersionIdentifier version21 = new PluginVersionIdentifier("2.1"); //$NON-NLS-1$ // CDT 2.1 is the first version using the new MBS model if (version.isGreaterOrEqualTo(version21)) { - // Check to see if all elements could be loaded correctly - for example, + // Check to see if all elements could be loaded correctly - for example, // if references in the project file could not be resolved to extension // elements if (buildInfo.getManagedProject() == null || @@ -2174,7 +2173,7 @@ public class ManagedBuildManager extends AbstractCExtension { // The load failed throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$ } - + // Each ToolChain/Tool/Builder element maintain two separate // converters if available // 0ne for previous Mbs versions and one for current Mbs version @@ -2195,7 +2194,7 @@ public class ManagedBuildManager extends AbstractCExtension { if (!UpdateManagedProjectManager.isCompatibleProject(buildInfo)) { UpdateManagedProjectManager.updateProject(project, buildInfo); } - // Check to see if the upgrade (if required) succeeded + // Check to see if the upgrade (if required) succeeded if (buildInfo.getManagedProject() == null || (!buildInfo.getManagedProject().isValid())) { // The load failed @@ -2212,11 +2211,11 @@ public class ManagedBuildManager extends AbstractCExtension { throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$ } } - + IConfiguration[] configs = buildInfo.getManagedProject().getConfigurations(); // Send an event to each configuration and if they exist, its resource configurations - for (int i=0; i < configs.length; ++i) { - ManagedBuildManager.performValueHandlerEvent(configs[i], IManagedOptionValueHandler.EVENT_OPEN); + for (IConfiguration cfg : configs) { + ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_OPEN); } // Finish up //project.setSessionProperty(buildInfoProperty, buildInfo); @@ -2225,7 +2224,7 @@ public class ManagedBuildManager extends AbstractCExtension { } catch (Exception e) { throw e; } - + buildInfo.setValid(true); return buildInfo; } @@ -2235,7 +2234,7 @@ public class ManagedBuildManager extends AbstractCExtension { * that have been installed with CDT. An internal hierarchy of * objects is created that contains the information from the manifest * files. The information is then accessed through the ManagedBuildManager. - * + * * Since the class does not have a constructor but all public methods * call this method first, it is effectively a startup method */ @@ -2245,7 +2244,7 @@ public class ManagedBuildManager extends AbstractCExtension { loadExtensionsSynchronized(); } - + private synchronized static void loadExtensionsSynchronized() throws BuildException { // Do this once if (projectTypesLoaded) @@ -2256,24 +2255,23 @@ public class ManagedBuildManager extends AbstractCExtension { return; projectTypesLoading = true; - + // scalability issue: configElementMap does not need to live past when loading is done, so we will // deallocate it upon exit with a try...finally - + try { - - //The list of the IManagedBuildDefinitionsStartup callbacks + + //The list of the IManagedBuildDefinitionsStartup callbacks List buildDefStartupList = null; // Get the extensions that use the current CDT managed build model IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID); if( extensionPoint != null) { IExtension[] extensions = extensionPoint.getExtensions(); if (extensions != null) { - + // First call the constructors of the internal classes that correspond to the // build model elements - for (int i = 0; i < extensions.length; ++i) { - IExtension extension = extensions[i]; + for (IExtension extension : extensions) { // Can we read this manifest if (!isVersionCompatible(extension)) { // The version of the Plug-in is greater than what the manager thinks it understands @@ -2288,37 +2286,35 @@ public class ManagedBuildManager extends AbstractCExtension { final String errMsg = ManagedMakeMessages.getFormattedString(MANIFEST_VERSION_ERROR, extension.getUniqueIdentifier()); shell.getDisplay().asyncExec( new Runnable() { public void run() { - MessageDialog.openError(shell, + MessageDialog.openError(shell, ManagedMakeMessages.getResourceString("ManagedBuildManager.error.manifest_load_failed_title"), //$NON-NLS-1$ errMsg); } } ); - } else { + } else { // Get the "configuraton elements" defined in the plugin.xml file. // Note that these "configuration elements" are not related to the - // managed build system "configurations". + // managed build system "configurations". // From the PDE Guide: - // A configuration element, with its attributes and children, directly - // reflects the content and structure of the extension section within the - // declaring plug-in's manifest (plugin.xml) file. + // A configuration element, with its attributes and children, directly + // reflects the content and structure of the extension section within the + // declaring plug-in's manifest (plugin.xml) file. IConfigurationElement[] elements = extension.getConfigurationElements(); String revision = null; - + // Get the managedBuildRevsion of the extension. - for (int j = 0; j < elements.length; j++) { - IConfigurationElement element = elements[j]; - - if( element.getName().equals(REVISION_ELEMENT_NAME) ) { + for (IConfigurationElement element : elements) { + if( element.getName().equals(REVISION_ELEMENT_NAME) ) { revision = element.getAttribute(VERSION_ELEMENT_NAME); break; } } - + // Get the value of 'ManagedBuildRevision' attribute loadConfigElements(DefaultManagedConfigElement.convertArray(elements, extension), revision); } } - + // Call the start up config extensions. These may rely on the standard elements // having already been loaded so we wait to call them from here. if (startUpConfigElements != null) { @@ -2328,24 +2324,24 @@ public class ManagedBuildManager extends AbstractCExtension { IManagedBuildDefinitionsStartup customConfigLoader; try { customConfigLoader = createStartUpConfigLoader((DefaultManagedConfigElement)iter.next()); - + //need to save the startup for the future notifications buildDefStartupList.add(customConfigLoader); - + // Now we can perform any actions on the build configurations // in an extended plugin before the build configurations have been resolved - customConfigLoader.buildDefsLoaded(); + customConfigLoader.buildDefsLoaded(); } catch (CoreException e) {} } } - + // Then call resolve. // // Here are notes on "references" within the managed build system. // References are "pointers" from one model element to another. // These are encoded in manifest and managed build system project files (.cdtbuild) // using unique string IDs (e.g. "cdt.managedbuild.tool.gnu.c.linker"). - // These string IDs are "resolved" to pointers to interfaces in model + // These string IDs are "resolved" to pointers to interfaces in model // elements in the in-memory represent of the managed build system information. // // Here are the current "rules" for references: @@ -2454,27 +2450,25 @@ public class ManagedBuildManager extends AbstractCExtension { if( extensionPoint != null) { IExtension[] extensions = extensionPoint.getExtensions(); String revision = null; - + if (extensions != null) { if (extensions.length > 0) { - + // Call the constructors of the internal classes that correspond to the // V2.0 build model elements. Some of these objects are converted to new model objects. // Others can use the same classes. - for (int i = 0; i < extensions.length; ++i) { - IExtension extension = extensions[i]; + for (IExtension extension : extensions) { // Can we read this manifest if (!isVersionCompatible(extension)) { //The version of the Plug-in is greater than what the manager thinks it understands throw new BuildException(ManagedMakeMessages.getResourceString(MANIFEST_VERSION_ERROR)); - } - IConfigurationElement[] elements = extension.getConfigurationElements(); - + } + IConfigurationElement[] elements = extension.getConfigurationElements(); + // Get the managedBuildRevsion of the extension. - for (int j = 0; j < elements.length; j++) { - IConfigurationElement element = elements[j]; + for (IConfigurationElement element : elements) { if(element.getName().equals(REVISION_ELEMENT_NAME)) { - revision = element.getAttribute(VERSION_ELEMENT_NAME); + revision = element.getAttribute(VERSION_ELEMENT_NAME); break; } } @@ -2494,7 +2488,7 @@ public class ManagedBuildManager extends AbstractCExtension { ex.printStackTrace(); } } - // The V2 model can also add top-level Tools - they need to be "resolved" + // The V2 model can also add top-level Tools - they need to be "resolved" Iterator toolIter = getExtensionToolMap().values().iterator(); while (toolIter.hasNext()) { try { @@ -2549,97 +2543,96 @@ public class ManagedBuildManager extends AbstractCExtension { } } } - + // configs resolved... - // Call the start up config extensions again now that configs have been resolved. + // Call the start up config extensions again now that configs have been resolved. if (buildDefStartupList != null) { for (Iterator iter = buildDefStartupList.iterator(); iter.hasNext();) { IManagedBuildDefinitionsStartup customConfigLoader = (IManagedBuildDefinitionsStartup)iter.next(); // Now we can perform any actions on the build configurations // in an extended plugin now that all build configruations have been resolved - customConfigLoader.buildDefsResolved(); + customConfigLoader.buildDefsResolved(); } } - + performAdjustments(); projectTypesLoading = false; projectTypesLoaded = true; - + ToolChainModificationManager.getInstance().start(); - + } // try - + finally { configElementMap = null; } } - + private static void performAdjustments(){ IProjectType types[] = getDefinedProjectTypes(); - for(int i = 0; i < types.length; i++){ - IConfiguration cfgs[] = types[i].getConfigurations(); - for(int j = 0; j < cfgs.length; j++){ - adjustConfig(cfgs[j]); + for (IProjectType type : types) { + IConfiguration cfgs[] = type.getConfigurations(); + for (IConfiguration cfg : cfgs) { + adjustConfig(cfg); } } - for(int i = 0; i < types.length; i++){ - IConfiguration cfgs[] = types[i].getConfigurations(); - for(int j = 0; j < cfgs.length; j++){ - performValueHandlerEvent(cfgs[j], IManagedOptionValueHandler.EVENT_LOAD); + for (IProjectType type : types) { + IConfiguration cfgs[] = type.getConfigurations(); + for (IConfiguration cfg : cfgs) { + performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_LOAD); } } } - + private static void adjustConfig(IConfiguration cfg){ IResourceInfo rcInfos[] = cfg.getResourceInfos(); - for(int i = 0 ; i < rcInfos.length; i++){ - if(rcInfos[i] instanceof IFolderInfo){ - IFolderInfo info = (IFolderInfo)rcInfos[i]; + for (IResourceInfo rcInfo : rcInfos) { + if(rcInfo instanceof IFolderInfo){ + IFolderInfo info = (IFolderInfo)rcInfo; IToolChain tc = info.getToolChain(); adjustHolder(info, tc); ITool tools[] = tc.getTools(); - for(int j = 0; j < tools.length; j++){ - adjustHolder(info, tools[j]); + for (ITool tool : tools) { + adjustHolder(info, tool); } - } else if (rcInfos[i] instanceof IFileInfo){ - IFileInfo info = (IFileInfo)rcInfos[i]; + } else if (rcInfo instanceof IFileInfo){ + IFileInfo info = (IFileInfo)rcInfo; ITool rcTools[] = info.getTools(); - for(int j = 0; j < rcTools.length; j++){ - adjustHolder(info, rcTools[j]); + for (ITool rcTool : rcTools) { + adjustHolder(info, rcTool); } - + } } - + IResourceConfiguration rcCfgs[] = cfg.getResourceConfigurations(); - - for(int i = 0; i - * The typical sequence of calls to add a new build information object to + * The typical sequence of calls to add a new build information object to * a managed build project is *

 	 * ManagedBuildManager.createBuildInfo(project);
 	 * // Do whatever initialization you need here
 	 * ManagedBuildManager.createTarget(project);
 	 * ManagedBuildManager.initBuildInfoContainer(project);
-	 *   
+	 *
 	 * @param resource The resource the build information is associated with
 	 */
 	public static ManagedBuildInfo createBuildInfo(IResource resource) {
@@ -2735,7 +2727,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return buildInfo;
 	}
-	
+
 	public static void setLoaddedBuildInfo(IProject project, IManagedBuildInfo info) throws CoreException{
 		// Associate the build info with the project for the duration of the session
 		//project.setSessionProperty(buildInfoProperty, info);
@@ -2753,11 +2745,11 @@ public class ManagedBuildManager extends AbstractCExtension {
 //			mngr.endRule(rule);
 //		}
 	}
-	
+
 	private synchronized static void doSetLoaddedInfo(IProject project, IManagedBuildInfo info, boolean overwrite){
 		if(!overwrite && fInfoMap.get(project) != null)
 			return;
-		
+
 		if(info != null){
 			fInfoMap.put(project, info);
 			if(BuildDbgUtil.DEBUG)
@@ -2768,7 +2760,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info CLEARED for project " + project.getName()); //$NON-NLS-1$
 		}
 	}
-	
+
 	private static IManagedConfigElementProvider createConfigProvider(
 		DefaultManagedConfigElement element) throws CoreException {
 
@@ -2776,13 +2768,13 @@ public class ManagedBuildManager extends AbstractCExtension {
 			createExecutableExtension(IManagedConfigElementProvider.CLASS_ATTRIBUTE);
 	}
 
-	
+
 	private static IManagedBuildDefinitionsStartup createStartUpConfigLoader(
 			DefaultManagedConfigElement element) throws CoreException {
-		
+
 			return (IManagedBuildDefinitionsStartup)element.getConfigurationElement().createExecutableExtension(IManagedBuildDefinitionsStartup.CLASS_ATTRIBUTE);
 		}
-	
+
 	/**
 	 * @param project
 	 * @return
@@ -2798,9 +2790,9 @@ public class ManagedBuildManager extends AbstractCExtension {
 		if(cfg != null)
 			return true;
 		return false;
-		
 
-		//		// The managed build manager manages build information for the 
+
+		//		// The managed build manager manages build information for the
 //		// resource IFF it it is a project and has a build file with the proper
 //		// root element
 //		IProject project = null;
@@ -2827,12 +2819,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 	}
 
 	/* (non-Javadoc)
-	 * Provate helper method that first checks to see if a build information 
-	 * object has been associated with the project for the current workspace 
-	 * session. If one cannot be found, one is created from the project file 
-	 * associated with the argument. If there is no prject file or the load 
-	 * fails for some reason, the method will return null 
-	 *  
+	 * Provate helper method that first checks to see if a build information
+	 * object has been associated with the project for the current workspace
+	 * session. If one cannot be found, one is created from the project file
+	 * associated with the argument. If there is no prject file or the load
+	 * fails for some reason, the method will return null
+	 *
 	 * @param resource
 	 * @return
 	 */
@@ -2852,7 +2844,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, querying the update mngr"); //$NON-NLS-1$
 			buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(proj);
 		}
-		
+
 		if(buildInfo != null)
 			return buildInfo;
 
@@ -2864,10 +2856,10 @@ public class ManagedBuildManager extends AbstractCExtension {
 				BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: core exception while getting the loaded info: " + e.getLocalizedMessage()); //$NON-NLS-1$
 			return null;
 		}
-	
+
 		if(buildInfo == null /*&& forceLoad*/){
 			int flags = forceLoad ? 0 : ICProjectDescriptionManager.GET_IF_LOADDED;
-			
+
 			if(BuildDbgUtil.DEBUG)
 				BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info is NOT loadded" + (forceLoad ? " forceload" : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			ICProjectDescription projDes = CoreModel.getDefault().getProjectDescriptionManager().getProjectDescription(proj, flags);
@@ -2881,16 +2873,16 @@ public class ManagedBuildManager extends AbstractCExtension {
 						BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: core exception while getting the loaded info (2): " + e.getLocalizedMessage()); //$NON-NLS-1$
 					return null;
 				}
-				
+
 				if(buildInfo == null){
 					if(BuildDbgUtil.DEBUG)
 						BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, trying the cfg data provider"); //$NON-NLS-1$
-					
+
 					buildInfo = ConfigurationDataProvider.getLoaddedBuildInfo(projDes);
 					if(buildInfo != null){
 						if(BuildDbgUtil.DEBUG)
 							BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info found, setting as loadded"); //$NON-NLS-1$
-						
+
 						try {
 							setLoaddedBuildInfo(proj, buildInfo);
 						} catch (CoreException e) {
@@ -2898,14 +2890,14 @@ public class ManagedBuildManager extends AbstractCExtension {
 								BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: core exception while setting loaded description, ignoring; : " + e.getLocalizedMessage()); //$NON-NLS-1$
 						}
 					}
-						
+
 				}
 
 			} else if(BuildDbgUtil.DEBUG){
 				BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: project description in null"); //$NON-NLS-1$
 			}
 
-			
+
 //			if(buildInfo == null){
 //				if(BuildDbgUtil.DEBUG)
 //					BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, querying the update mngr"); //$NON-NLS-1$
@@ -2914,7 +2906,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 //		if (buildInfo == null && resource instanceof IProject)
 //			buildInfo = findBuildInfoSynchronized((IProject)resource, forceLoad);
-/*		
+/*
 		// Nothing in session store, so see if we can load it from cdtbuild
 		if (buildInfo == null && resource instanceof IProject) {
 			try {
@@ -2922,7 +2914,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 			} catch (Exception e) {
 				// TODO:  Issue error reagarding not being able to load the project file (.cdtbuild)
 			}
-			
+
 			try {
 				// Check if the project needs its container initialized
 				initBuildInfoContainer(buildInfo);
@@ -2933,7 +2925,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 */
 		if(buildInfo != null)
 			buildInfo.updateOwner(proj);
-		
+
 		if(BuildDbgUtil.DEBUG){
 			if(buildInfo == null)
 				BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info is null"); //$NON-NLS-1$
@@ -2943,7 +2935,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 		return buildInfo;
 	}
-	
+
 	synchronized static ManagedBuildInfo getLoadedBuildInfo(IProject project) throws CoreException{
 		// Check if there is any build info associated with this project for this session
 		ManagedBuildInfo buildInfo = (ManagedBuildInfo)fInfoMap.get(project);//project.getSessionProperty(buildInfoProperty);
@@ -2951,7 +2943,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		if (buildInfo != null) {
 			buildInfo.updateOwner(project);
 		}
-		return buildInfo;	
+		return buildInfo;
 	}
 
 	/* (non-Javadoc)
@@ -2974,16 +2966,16 @@ public class ManagedBuildManager extends AbstractCExtension {
 			e.printStackTrace();
 			return false;
 		}
-		
+
 		ManagedBuildInfo buildInfo = null;
 
 		// Check if there is any build info associated with this project for this session
 		try {
-			buildInfo = (ManagedBuildInfo)getLoadedBuildInfo(resource.getProject());
+			buildInfo = getLoadedBuildInfo(resource.getProject());
 		} catch (CoreException e) {
 			// Continue, to see if any of the upcoming checks are successful
 		}
-		
+
 		if (buildInfo == null && resource instanceof IProject) {
 			// Check weather getBuildInfo is called from converter
 			buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo((IProject)resource);
@@ -2997,11 +2989,11 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 	/* (non-Javadoc)
 	 * this method is called if managed build info session property
-	 * was not set. The caller will use the project rule 
+	 * was not set. The caller will use the project rule
 	 * to synchronize with other callers
 	 * findBuildInfoSynchronized could also be called from project converter
 	 * in this case the ManagedBuildInfo saved in the converter would be returned
-	 *  
+	 *
 	 * @param resource
 	 * @return
 	 */
@@ -3018,7 +3010,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		} catch (CoreException e) {
 	//		return null;
 		}
-		
+
 		if(buildInfo == null && forceLoad){
 			// Make sure the extension information is loaded first
 			try {
@@ -3028,10 +3020,10 @@ public class ManagedBuildManager extends AbstractCExtension {
 				return null;
 			}
 
-			
+
 			// Check weather getBuildInfo is called from converter
 			buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(project);
-			
+
 			// Nothing in session store, so see if we can load it from cdtbuild
 			if (buildInfo == null) {
 				try {
@@ -3039,7 +3031,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				} catch (Exception e) {
 					// Issue error regarding not being able to load the project file (.cdtbuild)
 					if (buildInfo == null) {
-						buildInfo = createBuildInfo(project); 
+						buildInfo = createBuildInfo(project);
 					}
 					buildInfo.setValid(false);
 					//  Display error message
@@ -3050,12 +3042,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 					}
 
 					final Shell shell = window.getShell();
-					final String exceptionMsg = e.getMessage(); 
+					final String exceptionMsg = e.getMessage();
 					//using syncExec could cause a dead-lock
 					//that is why asyncExec is used
 					shell.getDisplay().asyncExec( new Runnable() {
 						public void run() {
-							MessageDialog.openError(shell, 
+							MessageDialog.openError(shell,
 									ManagedMakeMessages.getResourceString("ManagedBuildManager.error.open_failed_title"),	//$NON-NLS-1$
 									ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.open_failed",			//$NON-NLS-1$
 											exceptionMsg));
@@ -3066,7 +3058,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				if (buildInfo != null && !buildInfo.isContainerInited()) {
 					//  NOTE:  If this is called inside the above rule, then an IllegalArgumentException can
 					//         occur when the CDT project file is saved - it uses the Workspace Root as the scheduling rule.
-					//         
+					//
 					try {
 						// Check if the project needs its container initialized
 						initBuildInfoContainer(buildInfo);
@@ -3079,15 +3071,15 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 		return buildInfo;
 	}
-*/	
+*/
 	/**
-	 * Finds, but does not create, the managed build information for the 
+	 * Finds, but does not create, the managed build information for the
 	 * argument.
 	 * Loads the build info in case it is not currently loadded
 	 * Calling this method is the same as calling getBuildInfo(IResource resource, boolean forceLoad)
 	 * with the "forceLoad" argument set to true
-	 * 
-	 * 
+	 *
+	 *
 	 * @see ManagedBuildManager#initBuildInfo(IResource)
 	 * @param resource The resource to search for managed build information on.
 	 * @return IManagedBuildInfo The build information object for the resource.
@@ -3102,20 +3094,20 @@ public class ManagedBuildManager extends AbstractCExtension {
 			info = getLoadedBuildInfo(project);
 		} catch (CoreException e) {
 		}
-		
+
 		if(info == null){
 			try {
 				info = loadOldStyleBuildInfo(project);
-				
+
 				if(info != null)
 					doSetLoaddedInfo(project, info, false);
 			} catch (Exception e) {
 				throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e));
 			}
 		}
-		
+
 		return info;
-		
+
 	}
 
 	public static synchronized IManagedBuildInfo getBuildInfoLegacy(IProject project){
@@ -3127,12 +3119,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 	}
 	/**
-	 * Finds, but does not create, the managed build information for the 
+	 * Finds, but does not create, the managed build information for the
 	 * argument.
 	 * If the build info is not currently loadded and "forceLoad" argument is set to true,
 	 * loads the build info from the .cdtbuild file
 	 * In case "forceLoad" is false, does not load the build info and returns null in case it is not loadded
-	 * 
+	 *
 	 * @see ManagedBuildManager#initBuildInfo(IResource)
 	 * @param resource The resource to search for managed build information on.
 	 * @param forceLoad specifies whether the build info should be loadded in case it is not loadded currently.
@@ -3143,9 +3135,9 @@ public class ManagedBuildManager extends AbstractCExtension {
 	}
 
 	/**
-	 * Determines if the managed build information for the 
+	 * Determines if the managed build information for the
 	 * argument can be found.
-	 * 
+	 *
 	 * @see ManagedBuildManager#initBuildInfo(IResource)
 	 * @param resource The resource to search for managed build information on.
 	 * @return boolean True if the build info can be found; false otherwise.
@@ -3156,7 +3148,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 	/**
 	 * Answers the current version of the managed builder plugin.
-	 * 
+	 *
 	 * @return the current version of the managed builder plugin
 	 */
 	public static PluginVersionIdentifier getBuildInfoVersion() {
@@ -3164,30 +3156,28 @@ public class ManagedBuildManager extends AbstractCExtension {
 	}
 
 	/**
-	 * Get the full URL for a path that is relative to the plug-in 
+	 * Get the full URL for a path that is relative to the plug-in
 	 * in which .buildDefinitions are defined
-	 * 
+	 *
 	 * @return the full URL for a path relative to the .buildDefinitions
 	 *         plugin
 	 */
 	public static URL getURLInBuildDefinitions(DefaultManagedConfigElement element, IPath path) {
-		
+
 		IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
 		if( extensionPoint != null) {
 			IExtension[] extensions = extensionPoint.getExtensions();
 			if (extensions != null) {
-				
+
 				// Iterate over all extensions that contribute to .buildDefinitions
-				for (int i = 0; i < extensions.length; ++i) {
-					IExtension extension = extensions[i];
-					
+				for (IExtension extension : extensions) {
 					// Determine whether the configuration element that is
 					// associated with the path, is valid for the extension that
 					// we are currently processing.
 					//
 					// Note: If not done, icon file names would have to be unique
 					// across several plug-ins.
-					if (element.getExtension().getExtensionPointUniqueIdentifier() 
+					if (element.getExtension().getExtensionPointUniqueIdentifier()
 						 == extension.getExtensionPointUniqueIdentifier())
 					{
 						// Get the path-name
@@ -3209,11 +3199,11 @@ public class ManagedBuildManager extends AbstractCExtension {
 						}
 					}
 				}
-			}			
-		}		
+			}
+		}
 		return null;
-	}	
-	
+	}
+
 	/*
 	 * @return
 	 */
@@ -3227,22 +3217,22 @@ public class ManagedBuildManager extends AbstractCExtension {
 	private static Map getConfigElementMap() {
 		if(!projectTypesLoading)
 			throw new IllegalStateException();
-		
+
 		if (configElementMap == null) {
 			configElementMap = new HashMap();
 		}
 		return configElementMap;
 	}
-	
+
 	/**
-	 * @noreference This method public for implementation reasons.  Not intended for use 
+	 * @noreference This method public for implementation reasons.  Not intended for use
 	 * by clients.
 	 *
 	 */
 	public static void putConfigElement(IBuildObject buildObj, IManagedConfigElement configElement) {
 		getConfigElementMap().put(buildObj, configElement);
 	}
-	
+
 	/**
 	 * Removes an item from the map
 	 */
@@ -3251,13 +3241,13 @@ public class ManagedBuildManager extends AbstractCExtension {
 	}
 
 	/**
-	 * @noreference This method public for implementation reasons.  Not intended for use 
+	 * @noreference This method public for implementation reasons.  Not intended for use
 	 * by clients.
 	 */
 	public static IManagedConfigElement getConfigElement(IBuildObject buildObj) {
 		return (IManagedConfigElement)getConfigElementMap().get(buildObj);
 	}
-	
+
 	public static void optionValidError(int errorId, String id) {
 		String[] msgs = new String[1];
 		msgs[0] = id;
@@ -3272,7 +3262,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 			break;
 		}
 	}
-	
+
 	public static void optionValueHandlerError(String attribute, String id) {
 		String[] msgs = new String[2];
 		msgs[0] = attribute;
@@ -3280,7 +3270,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		ManagedBuildManager.outputManifestError(
 			ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_OPTION_VALUEHANDLER, msgs));
 	}
-	
+
 	public static void outputResolveError(String attribute, String lookupId, String type, String id) {
 		String[] msgs = new String[4];
 		msgs[0] = attribute;
@@ -3290,7 +3280,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		ManagedBuildManager.outputManifestError(
 			ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_RESOLVING, msgs));
 	}
-	
+
 	public static void outputDuplicateIdError(String type, String id) {
 		String[] msgs = new String[2];
 		msgs[0] = type;
@@ -3298,47 +3288,47 @@ public class ManagedBuildManager extends AbstractCExtension {
 		ManagedBuildManager.outputManifestError(
 			ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_DUPLICATE, msgs));
 	}
-	
+
 	public static void outputManifestError(String message) {
 		System.err.println(ManagedMakeMessages.getResourceString(MANIFEST_ERROR_HEADER) + message + NEWLINE);
 	}
-	
+
 	public static void outputIconError(String iconLocation) {
 		String[] msgs = new String[1];
 		msgs[0]= iconLocation;
 		ManagedBuildManager.outputManifestError(
 			ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_ICON, msgs));
 	}
-	
+
 	/**
 	 * Returns the instance of the Environment Variable Provider
-	 * 
+	 *
 	 * @return IEnvironmentVariableProvider
 	 */
 	public static IEnvironmentVariableProvider getEnvironmentVariableProvider(){
 		return EnvironmentVariableProvider.getDefault();
 	}
-	
+
 	/**
 	 * Returns the version, if 'id' contains a valid version
-	 * Returns null if 'id' does not contain a valid version 
+	 * Returns null if 'id' does not contain a valid version
 	 * Returns null if 'id' does not contain a version
-	 * 
+	 *
 	 * @param idAndVersion
 	 * @return String
 	 */
-	
+
 	public static String getVersionFromIdAndVersion(String idAndVersion) {
-				
+
 //		 Get the index of the separator '_' in tool id.
 		int index = idAndVersion.lastIndexOf('_');
 
-		//Validate the version number if exists.		
+		//Validate the version number if exists.
 		if ( index != -1) {
 			// Get the version number from tool id.
 			String version = idAndVersion.substring(index+1);
 			IStatus status = PluginVersionIdentifier.validateVersion(version);
-			
+
 			// If there is a valid version then return 'version'
 			if ( status.isOK())
 				return version;
@@ -3346,11 +3336,11 @@ public class ManagedBuildManager extends AbstractCExtension {
 		// If there is no version information or not a valid version, return null
 		return null;
 	}
-	
+
 	/**
 	 * If the input to this function contains 'id & a valid version', it returns only the 'id' part
 	 * Otherwise it returns the received input back.
-	 * 
+	 *
 	 * @param idAndVersion
 	 * @return String
 	 */
@@ -3369,34 +3359,34 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 	/**
 	 * Returns the instance of the Build Macro Provider
-	 * 
+	 *
 	 * @return IBuildMacroProvider
 	 */
 	public static IBuildMacroProvider getBuildMacroProvider(){
 		return BuildMacroProvider.getDefault();
 	}
-	
+
 	/**
 	 * Send event to value handlers of relevant configuration including
 	 * all its child resource configurations, if they exist.
-	 * 
+	 *
 	 * @param IConfiguration configuration for which to send the event
 	 * @param event to be sent
-	 * 
+	 *
 	 * @since 3.0
 	 */
 	public static void performValueHandlerEvent(IConfiguration config, int event) {
-		performValueHandlerEvent(config, event, true);		
+		performValueHandlerEvent(config, event, true);
 	}
-	
+
 	/**
 	 * Send event to value handlers of relevant configuration.
-	 * 
+	 *
 	 * @param IConfiguration configuration for which to send the event
 	 * @param event to be sent
-	 * @param doChildren - if true, also perform the event for all 
-	 *        resource configurations that are children if this configuration. 
-	 * 
+	 * @param doChildren - if true, also perform the event for all
+	 *        resource configurations that are children if this configuration.
+	 *
 	 * @since 3.0
 	 */
 	public static void performValueHandlerEvent(IConfiguration config, int event, boolean doChildren) {
@@ -3404,106 +3394,106 @@ public class ManagedBuildManager extends AbstractCExtension {
 		IToolChain toolChain = config.getToolChain();
 		if (toolChain == null)
 			return;
-		
+
 		IOption[] options = toolChain.getOptions();
 		// Get global options directly under Toolchain (not associated with a particular tool)
 		// This has to be sent to all the Options associated with this configuration.
-		for (int i = 0; i < options.length; ++i) {
+		for (IOption option : options) {
 			// Ignore invalid options
-			if (options[i].isValid()) {
+			if (option.isValid()) {
 				// Call the handler
-				if (options[i].getValueHandler().handleValue(
-						config, 
-						toolChain, 
-						options[i], 
-						options[i].getValueHandlerExtraArgument(), 
+				if (option.getValueHandler().handleValue(
+						config,
+						toolChain,
+						option,
+						option.getValueHandlerExtraArgument(),
 						event)) {
 					// TODO : Event is handled successfully and returned true.
 					// May need to do something here say logging a message.
 				} else {
-					// Event handling Failed. 
+					// Event handling Failed.
 				}
 			}
 		}
 
 		// Get options associated with tools under toolChain
 		ITool[] tools = config.getFilteredTools();
-		for (int i = 0; i < tools.length; ++i) {
-			IOption[] toolOptions = tools[i].getOptions();
-			for (int j = 0; j < toolOptions.length; ++j) {
+		for (ITool tool : tools) {
+			IOption[] toolOptions = tool.getOptions();
+			for (IOption toolOption : toolOptions) {
 				// Ignore invalid options
-				if (toolOptions[j].isValid()) {
+				if (toolOption.isValid()) {
 					// Call the handler
-					if (toolOptions[j].getValueHandler().handleValue(
-							config, 
-							tools[i], 
-							toolOptions[j], 
-							toolOptions[j].getValueHandlerExtraArgument(), 
+					if (toolOption.getValueHandler().handleValue(
+							config,
+							tool,
+							toolOption,
+							toolOption.getValueHandlerExtraArgument(),
 							event)) {
 						// TODO : Event is handled successfully and returned true.
 						// May need to do something here say logging a message.
 					} else {
-						// Event handling Failed. 
+						// Event handling Failed.
 					}
 				}
 			}
 		}
-		
+
 		// Call backs for Resource Configurations associated with this config.
 		if (doChildren == true) {
 			IResourceConfiguration[] resConfigs = config.getResourceConfigurations();
-			for (int j=0; j < resConfigs.length; ++j) {
-				ManagedBuildManager.performValueHandlerEvent(resConfigs[j], event);
-			}			
+			for (IResourceConfiguration resConfig : resConfigs) {
+				ManagedBuildManager.performValueHandlerEvent(resConfig, event);
+			}
 		}
 	}
-	
+
 	/**
 	 * Send event to value handlers of relevant configuration.
-	 * 
+	 *
 	 * @param IResourceConfiguration configuration for which to send the event
 	 * @param event to be sent
-	 * 
+	 *
 	 * @since 3.0
 	 */
 	public static void performValueHandlerEvent(IResourceInfo config, int event) {
 
 		// Note: Resource configurations have no toolchain options
-		
+
 		// Get options associated with the resource configuration
-		ITool[] tools = config instanceof IFileInfo ? 
+		ITool[] tools = config instanceof IFileInfo ?
 				((IFileInfo)config).getToolsToInvoke() :
 					((IFolderInfo)config).getFilteredTools();
-		for (int i = 0; i < tools.length; ++i) {
-			IOption[] toolOptions = tools[i].getOptions();
-			for (int j = 0; j < toolOptions.length; ++j) {
+		for (ITool tool : tools) {
+			IOption[] toolOptions = tool.getOptions();
+			for (IOption toolOption : toolOptions) {
 				// Ignore invalid options
-				if (toolOptions[j].isValid()) {
+				if (toolOption.isValid()) {
 					// Call the handler
-					if (toolOptions[j].getValueHandler().handleValue(
-							config, 
-							tools[i], 
-							toolOptions[j], 
-							toolOptions[j].getValueHandlerExtraArgument(), 
+					if (toolOption.getValueHandler().handleValue(
+							config,
+							tool,
+							toolOption,
+							toolOption.getValueHandlerExtraArgument(),
 							event)) {
 						// TODO : Event is handled successfully and returned true.
 						// May need to do something here say logging a message.
 					} else {
-						// Event handling Failed. 
+						// Event handling Failed.
 					}
 				}
 			}
 		}
 	}
-	
+
 	private static boolean checkForMigrationSupport(ManagedBuildInfo buildInfo,
 			boolean forCurrentMbsVersion) {
-		
+
 		IConfigurationElement element = null;
 
 		// Get the managed project from buildInfo
 		IManagedProject managedProject = buildInfo.getManagedProject();
-		
+
 		IProjectType projectType = managedProject.getProjectType();
 		if (forCurrentMbsVersion) {
 			element = ((ProjectType) projectType)
@@ -3521,13 +3511,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 			if (invokeConverter(buildInfo, managedProject, element) == null) {
 				buildInfo.getManagedProject().setValid(false);
 				return false;
-			}			
+			}
 		} else {
 			// other wise, walk through the hierarchy of the project and
 			// call the converters if available for each configuration
 			IConfiguration[] configs = managedProject.getConfigurations();
-			for (int i = 0; i < configs.length; i++) {
-				IConfiguration configuration = configs[i];
+			for (IConfiguration configuration : configs) {
 				IToolChain toolChain = configuration.getToolChain();
 
 				if (forCurrentMbsVersion) {
@@ -3550,8 +3539,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 					// If there are no converters for toolChain, walk through
 					// it's children
 					ITool[] tools = toolChain.getTools();
-					for (int j = 0; j < tools.length; j++) {
-						ITool tool = tools[j];
+					for (ITool tool : tools) {
 						if (forCurrentMbsVersion) {
 							element = ((Tool) tool)
 									.getCurrentMbsVersionConversionElement();
@@ -3591,11 +3579,9 @@ public class ManagedBuildManager extends AbstractCExtension {
 				IResourceConfiguration[] resourceConfigs = configuration
 						.getResourceConfigurations();
 				if ((resourceConfigs != null) && (resourceConfigs.length > 0)) {
-					for (int j = 0; j < resourceConfigs.length; j++) {
-						IResourceConfiguration resConfig = resourceConfigs[j];
+					for (IResourceConfiguration resConfig : resourceConfigs) {
 						ITool[] resTools = resConfig.getTools();
-						for (int k = 0; k < resTools.length; k++) {
-							ITool resTool = resTools[k];
+						for (ITool resTool : resTools) {
 							if (forCurrentMbsVersion) {
 								element = ((Tool) resTool)
 										.getCurrentMbsVersionConversionElement();
@@ -3612,12 +3598,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 							}
 						}
 					}
-				} // end of if			
+				} // end of if
 			}
 		}
 		// If control comes here, it means either there is no converter element
 		// or converters are invoked successfully
-		
+
 		return true;
 	}
 
@@ -3653,11 +3639,11 @@ public class ManagedBuildManager extends AbstractCExtension {
 				return result;
 			}
 		}
-		// if control comes here, it means that either 'convertBuildObject' is null or 
+		// if control comes here, it means that either 'convertBuildObject' is null or
 		// converter did not convert the object successfully
 		return null;
 	}
-		
+
 	/*
 	 * Generic Converter function.
 	 * If the converter is available for the given Build Object, it calls the corresponding converter.
@@ -3677,13 +3663,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 		if (extensionPoint != null) {
 			// Get the extensions
 			IExtension[] extensions = extensionPoint.getExtensions();
-			for (int i = 0; i < extensions.length; i++) {
+			for (IExtension extension : extensions) {
 				// Get the configuration elements of each extension
-				IConfigurationElement[] configElements = extensions[i]
+				IConfigurationElement[] configElements = extension
 						.getConfigurationElements();
-				for (int j = 0; j < configElements.length; j++) {
+				for (IConfigurationElement element : configElements) {
 
-					IConfigurationElement element = configElements[j];
 					if (element.getName().equals("converter") && (isBuildObjectApplicableForConversion(buildObj, element) == true)) { //$NON-NLS-1$
 						tmpToId = element.getAttribute("toId");	//$NON-NLS-1$
 						if (tmpToId.equals(toId)) {
@@ -3698,8 +3683,8 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 	/*
 	 * Generic routine for checking the availability of converters for the given
-	 * Build Object. 
-	 * @param IBuildObject, This function takes a 'IBuildObject' as an argument 
+	 * Build Object.
+	 * @param IBuildObject, This function takes a 'IBuildObject' as an argument
 	 * @return true if there are converters for the given Build Object
 	 * @return false if there are no converters
 	 */
@@ -3713,13 +3698,10 @@ public class ManagedBuildManager extends AbstractCExtension {
 		if (extensionPoint != null) {
 			// Get the extensions
 			IExtension[] extensions = extensionPoint.getExtensions();
-			for (int i = 0; i < extensions.length; i++) {
+			for (IExtension extension : extensions) {
 				// Get the configuration elements of each extension
-				IConfigurationElement[] configElements = extensions[i]
-						.getConfigurationElements();
-				for (int j = 0; j < configElements.length; j++) {
-
-					IConfigurationElement element = configElements[j];
+				IConfigurationElement[] configElements = extension.getConfigurationElements();
+				for (IConfigurationElement element : configElements) {
 					if (element.getName().equals("converter") && (isBuildObjectApplicableForConversion(buildObj, element) == true)) //$NON-NLS-1$
 						return true;
 				}
@@ -3743,15 +3725,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 		if (extensionPoint != null) {
 			// Get the extensions
 			IExtension[] extensions = extensionPoint.getExtensions();
-			for (int i = 0; i < extensions.length; i++) {
+			for (IExtension extension : extensions) {
 				// Get the configuration elements of each extension
-				IConfigurationElement[] configElements = extensions[i]
-						.getConfigurationElements();
-				for (int j = 0; j < configElements.length; j++) {
-					IConfigurationElement element = configElements[j];
+				IConfigurationElement[] configElements = extension.getConfigurationElements();
+				for (IConfigurationElement element : configElements) {
 					if (element.getName().equals("converter") && (isBuildObjectApplicableForConversion(buildObj, element) == true)) { //$NON-NLS-1$
-						conversionTargets.put((String) element
-								.getAttribute("name"), element); //$NON-NLS-1$
+						conversionTargets.put(element.getAttribute("name"), element); //$NON-NLS-1$
 					}
 				}
 			}
@@ -3760,7 +3739,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 	}
 
 	/*
-	 * Generic function that checks whether the given conversion element can be used to convert the given 
+	 * Generic function that checks whether the given conversion element can be used to convert the given
 	 * build object. It returns true if the given build object is convertable, otherwise it returns false.
 	 */
 
@@ -3774,9 +3753,9 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 		if (buildObj instanceof IProjectType) {
 			IProjectType projType = (IProjectType) buildObj;
-			
+
 			// Check whether the converter's 'fromId' and the
-			// given projType 'id' are equal			
+			// given projType 'id' are equal
 			while (projType != null) {
 				id = projType.getId();
 
@@ -3787,7 +3766,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 			}
 		} else if (buildObj instanceof IToolChain) {
 			IToolChain toolChain = (IToolChain) buildObj;
-			
+
 			// Check whether the converter's 'fromId' and the
 			// given toolChain 'id' are equal
 			while (toolChain != null) {
@@ -3800,7 +3779,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 			}
 		} else if (buildObj instanceof ITool) {
 			ITool tool = (ITool) buildObj;
-			
+
 			// Check whether the converter's 'fromId' and the
 			// given tool 'id' are equal
 			while (tool != null) {
@@ -3813,7 +3792,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 			}
 		} else if (buildObj instanceof IBuilder) {
 			IBuilder builder = (IBuilder) buildObj;
-			
+
 			// Check whether the converter's 'fromId' and the
 			// given builder 'id' are equal
 			while (builder != null) {
@@ -3842,7 +3821,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 	}
 
 	/**
-	 * Calculate a relative path given the full path to a folder and a file 
+	 * Calculate a relative path given the full path to a folder and a file
 	 */
 	public static IPath calculateRelativePath(IPath container, IPath contents){
 		IPath path = contents;
@@ -3856,7 +3835,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				contents = contents.removeLastSegments(1);
 				contents = contents.addTrailingSeparator();
 			}
-			
+
 			IPath prefix = contents;
 			for(;prefix.segmentCount() > 0 && !prefix.isPrefixOf(container);prefix = prefix.removeLastSegments(1)){
 			}
@@ -3872,7 +3851,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return path;
 	}
-	
+
 /*	private static IBuildObject getBuildObjectFromDataObject(CDataObject data){
 		if(data instanceof BuildConfigurationData)
 			return ((BuildConfigurationData)data).getConfiguration();
@@ -3882,7 +3861,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 			return ((BuildFileData)data).getFileInfo();
 		return null;
 	}
-*/	
+*/
 	private static final boolean TEST_CONSISTENCE = false;
 
 	public static IConfiguration getConfigurationForDescription(ICConfigurationDescription cfgDes){
@@ -3892,13 +3871,13 @@ public class ManagedBuildManager extends AbstractCExtension {
 	private static IConfiguration getConfigurationForDescription(ICConfigurationDescription cfgDes, boolean checkConsistance){
 		if(cfgDes == null)
 			return null;
-		
+
 		if (cfgDes instanceof ICMultiConfigDescription) {
 			ICMultiConfigDescription mcd = (ICMultiConfigDescription)cfgDes;
 			ICConfigurationDescription[] cfds = (ICConfigurationDescription[])mcd.getItems();
 			return new MultiConfiguration(cfds);
 		}
-		
+
 		CConfigurationData cfgData = cfgDes.getConfigurationData();
 		if(cfgData instanceof BuildConfigurationData){
 			IConfiguration cfg = ((BuildConfigurationData)cfgData).getConfiguration();
@@ -3920,18 +3899,18 @@ public class ManagedBuildManager extends AbstractCExtension {
 	public static int optionTypeToEntryKind(int type){
 		switch(type){
 		case IOption.INCLUDE_PATH:
-			return ICLanguageSettingEntry.INCLUDE_PATH;
+			return ICSettingEntry.INCLUDE_PATH;
 		case IOption.PREPROCESSOR_SYMBOLS:
-			return ICLanguageSettingEntry.MACRO;
+			return ICSettingEntry.MACRO;
 		case IOption.INCLUDE_FILES:
-			return ICLanguageSettingEntry.INCLUDE_FILE;
+			return ICSettingEntry.INCLUDE_FILE;
 		case IOption.LIBRARY_PATHS:
-			return ICLanguageSettingEntry.LIBRARY_PATH;
+			return ICSettingEntry.LIBRARY_PATH;
 		case IOption.LIBRARIES:
 		case IOption.LIBRARY_FILES:
-			return ICLanguageSettingEntry.LIBRARY_FILE;
+			return ICSettingEntry.LIBRARY_FILE;
 		case IOption.MACRO_FILES:
-			return ICLanguageSettingEntry.MACRO_FILE;
+			return ICSettingEntry.MACRO_FILE;
 		}
 		return 0;
 	}
@@ -3944,52 +3923,52 @@ public class ManagedBuildManager extends AbstractCExtension {
 	public static int optionUndefTypeToEntryKind(int type){
 		switch(type){
 		case IOption.UNDEF_INCLUDE_PATH:
-			return ICLanguageSettingEntry.INCLUDE_PATH;
+			return ICSettingEntry.INCLUDE_PATH;
 		case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
-			return ICLanguageSettingEntry.MACRO;
+			return ICSettingEntry.MACRO;
 		case IOption.UNDEF_INCLUDE_FILES:
-			return ICLanguageSettingEntry.INCLUDE_FILE;
+			return ICSettingEntry.INCLUDE_FILE;
 		case IOption.UNDEF_LIBRARY_PATHS:
-			return ICLanguageSettingEntry.LIBRARY_PATH;
+			return ICSettingEntry.LIBRARY_PATH;
 		case IOption.UNDEF_LIBRARY_FILES:
-			return ICLanguageSettingEntry.LIBRARY_FILE;
+			return ICSettingEntry.LIBRARY_FILE;
 		case IOption.UNDEF_MACRO_FILES:
-			return ICLanguageSettingEntry.MACRO_FILE;
+			return ICSettingEntry.MACRO_FILE;
 		}
 		return 0;
 	}
 
 	public static int entryKindToOptionType(int kind){
 		switch(kind){
-		case ICLanguageSettingEntry.INCLUDE_PATH:
+		case ICSettingEntry.INCLUDE_PATH:
 			return IOption.INCLUDE_PATH;
-		case ICLanguageSettingEntry.INCLUDE_FILE:
+		case ICSettingEntry.INCLUDE_FILE:
 			return IOption.INCLUDE_FILES;
-		case ICLanguageSettingEntry.MACRO:
+		case ICSettingEntry.MACRO:
 			return IOption.PREPROCESSOR_SYMBOLS;
-		case ICLanguageSettingEntry.MACRO_FILE:
+		case ICSettingEntry.MACRO_FILE:
 			return IOption.MACRO_FILES;
-		case ICLanguageSettingEntry.LIBRARY_PATH:
+		case ICSettingEntry.LIBRARY_PATH:
 			return IOption.LIBRARY_PATHS;//TODO IOption.LIBRARIES;
-		case ICLanguageSettingEntry.LIBRARY_FILE:
+		case ICSettingEntry.LIBRARY_FILE:
 			return IOption.LIBRARY_FILES;
 		}
 		return 0;
 	}
-	
+
 	public static int entryKindToUndefOptionType(int kind){
 		switch(kind){
-		case ICLanguageSettingEntry.INCLUDE_PATH:
+		case ICSettingEntry.INCLUDE_PATH:
 			return IOption.UNDEF_INCLUDE_PATH;
-		case ICLanguageSettingEntry.INCLUDE_FILE:
+		case ICSettingEntry.INCLUDE_FILE:
 			return IOption.UNDEF_INCLUDE_FILES;
-		case ICLanguageSettingEntry.MACRO:
+		case ICSettingEntry.MACRO:
 			return IOption.UNDEF_PREPROCESSOR_SYMBOLS;
-		case ICLanguageSettingEntry.MACRO_FILE:
+		case ICSettingEntry.MACRO_FILE:
 			return IOption.UNDEF_MACRO_FILES;
-		case ICLanguageSettingEntry.LIBRARY_PATH:
+		case ICSettingEntry.LIBRARY_PATH:
 			return IOption.UNDEF_LIBRARY_PATHS;//TODO IOption.LIBRARIES;
-		case ICLanguageSettingEntry.LIBRARY_FILE:
+		case ICSettingEntry.LIBRARY_FILE:
 			return IOption.UNDEF_LIBRARY_FILES;
 		}
 		return 0;
@@ -4026,11 +4005,11 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return des;
 	}
-	
+
 	public static IPath getBuildFullPath(IConfiguration cfg, IBuilder builder){
 		IProject project = cfg.getOwner().getProject();
 //		String path = builder.getBuildPath();
-		
+
 		IPath buildDirectory = builder.getBuildLocation();
 		IPath fullPath = null;
 		if (buildDirectory != null && !buildDirectory.isEmpty()) {
@@ -4041,14 +4020,14 @@ public class ManagedBuildManager extends AbstractCExtension {
 				IContainer crs[] = ((IWorkspaceRoot)project.getParent()).findContainersForLocation(buildDirectory);
 				if(crs.length != 0){
 					String projName = project.getName();
-					for(int i = 0; i < crs.length; i++){
-						IPath path = crs[i].getFullPath();
+					for (IContainer cr : crs) {
+						IPath path = cr.getFullPath();
 						if(path.segmentCount() != 0 && path.segment(0).equals(projName)){
 							fullPath = path;
 							break;
 						}
 					}
-					
+
 					if(fullPath == null){
 						fullPath = crs[0].getFullPath();
 					}
@@ -4059,17 +4038,17 @@ public class ManagedBuildManager extends AbstractCExtension {
 			if(builder.isManagedBuildOn())
 				fullPath = fullPath.append(cfg.getName());
 		}
-		
+
 		return fullPath;
 	}
-	
+
 	public static String locationToFullPath(String path){
 		if(!path.startsWith("${"))  //$NON-NLS-1$
 			return null;
 		int index = path.lastIndexOf('}');
 		if(index == -1)
 			return null;
-		
+
 		String varName = "workspace_loc"; //$NON-NLS-1$
 		String str1 = path.substring(2, index);
 		String result = null;
@@ -4083,10 +4062,10 @@ public class ManagedBuildManager extends AbstractCExtension {
 				result = "/"; //$NON-NLS-1$
 			}
 		}
-		
+
 		return result;
 	}
-	
+
 	public static String fullPathToLocation(String path){
 		StringBuffer buf = new StringBuffer();
 		return buf.append("${").append("workspace_loc:").append(path).append("}").toString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -4095,8 +4074,8 @@ public class ManagedBuildManager extends AbstractCExtension {
 	public static IPath getBuildLocation(IConfiguration cfg, IBuilder builder) {
 		if(cfg.getOwner() == null)
 			return Path.EMPTY;
-		
-		IProject project = cfg.getOwner().getProject(); 
+
+		IProject project = cfg.getOwner().getProject();
 		IPath buildDirectory = builder.getBuildLocation();
 		if (buildDirectory != null && !buildDirectory.isEmpty()) {
 			IResource res = project.getParent().findMember(buildDirectory);
@@ -4105,7 +4084,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 			}
 		} else {
 			buildDirectory = getPathForResource(project);
-			
+
 			if (buildDirectory != null) {
 				if (builder.isManagedBuildOn())
 					buildDirectory = buildDirectory.append(cfg.getName());
@@ -4148,19 +4127,19 @@ public class ManagedBuildManager extends AbstractCExtension {
 	public static IBuilder[] createBuilders(IProject project, Map args){
 		return ManagedBuilderCorePlugin.createBuilders(project, args);
 	}
-	
+
 	public static IBuilder createCustomBuilder(IConfiguration cfg, String builderId) throws CoreException{
 		return ManagedBuilderCorePlugin.createCustomBuilder(cfg, builderId);
 	}
-	
+
 	public static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base){
 		return ManagedBuilderCorePlugin.createCustomBuilder(cfg, base);
 	}
-	
+
 	public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, String eclipseBuilderID) throws CoreException {
 		return ManagedBuilderCorePlugin.createBuilderForEclipseBuilder(cfg, eclipseBuilderID);
 	}
-	
+
 /*	public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue){
 		List all = getSortedToolChains();
 		List result = new ArrayList();
@@ -4172,12 +4151,12 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return (IToolChain[])result.toArray(new ToolChain[result.size()]);
 	}
-*/	
+*/
 /*	public static void resortToolChains(){
 		sortedToolChains = null;
 		getSortedToolChains();
 	}
-*/	
+*/
 /*	private static List getSortedToolChains(){
 		if(sortedToolChains == null){
 			sortedToolChains = new ArrayList();
@@ -4197,7 +4176,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return sortedToolChains;
 	}
-*/	
+*/
 //	private static List findIdenticalToolChains(IToolChain tc){
 //		ToolChain tCh = (ToolChain)tc;
 //		List list = tCh.getIdenticalList();
@@ -4212,38 +4191,38 @@ public class ManagedBuildManager extends AbstractCExtension {
 //
 //		return ((ToolChain)tc).getIdenticalList();
 //	}
-	
+
 	public static IToolChain[] getExtensionToolChains(IProjectType type){
 		List result = new ArrayList();
 		IConfiguration cfgs[] = type.getConfigurations();
-		
-		for(int i = 0; i < cfgs.length; i++){
-			IToolChain tc = cfgs[i].getToolChain();
+
+		for (IConfiguration cfg : cfgs) {
+			IToolChain tc = cfg.getToolChain();
 			if(tc == null)
 				continue;
-			
+
 			List list = findIdenticalElements((ToolChain)tc, fToolChainSorter);
 			int k = 0;
 			for(; k < result.size(); k++){
 				if(findIdenticalElements((ToolChain)result.get(k), fToolChainSorter) == list)
 					break;
 			}
-			
+
 			if(k == result.size()){
 				result.add(tc);
 			}
 		}
 		return (IToolChain[])result.toArray(new IToolChain[result.size()]);
 	}
-	
+
 	public static IConfiguration[] getExtensionConfigurations(IToolChain tChain, IProjectType type){
 		List list = new ArrayList();
 		IConfiguration cfgs[] = type.getConfigurations();
-		for(int i = 0; i < cfgs.length; i++){
-			IToolChain cur = cfgs[i].getToolChain();
+		for (IConfiguration cfg : cfgs) {
+			IToolChain cur = cfg.getToolChain();
 			if(cur != null
 					&& findIdenticalElements((ToolChain)cur, fToolChainSorter) == findIdenticalElements((ToolChain)tChain, fToolChainSorter)){
-				list.add(cfgs[i]);
+				list.add(cfg);
 			}
 		}
 		return (IConfiguration[])list.toArray(new Configuration[list.size()]);
@@ -4252,7 +4231,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 	public static IConfiguration getFirstExtensionConfiguration(IToolChain tChain){
 		if(tChain.getParent() != null)
 			return tChain.getParent();
-		
+
 		List list = findIdenticalElements((ToolChain)tChain, fToolChainSorter);
 		if(list != null){
 			for(int i = 0; i < list.size(); i++){
@@ -4261,7 +4240,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 					return cur.getParent();
 			}
 		}
-		
+
 		return null;
 	}
 
@@ -4276,7 +4255,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				if(cur == tChain){
 					tcFound = true;
 				}
-				
+
 				IConfiguration cfg = cur.getParent();
 				if(cfg != null){
 					IBuildObjectProperties props = cfg.getBuildProperties();
@@ -4285,9 +4264,9 @@ public class ManagedBuildManager extends AbstractCExtension {
 					}
 				}
 			}
-			
+
 		}
-		
+
 		if(!tcFound) {
 			IConfiguration cfg = tChain.getParent();
 			if(cfg != null){
@@ -4297,7 +4276,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				}
 			}
 		}
-		
+
 //		if(result.size() == 0){
 //			if(((ToolChain)tChain).supportsValue(propertyType, propertyValue)){
 //				IConfiguration cfg = getFirstExtensionConfiguration(tChain);
@@ -4308,7 +4287,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 //		}
 		return (IConfiguration[])result.toArray(new IConfiguration[result.size()]);
 	}
-	
+
 /*	public static IToolChain[] getRealToolChains(){
 		List all = getSortedToolChains();
 		IToolChain tcs[] = new ToolChain[all.size()];
@@ -4318,9 +4297,9 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return tcs;
 	}
-*/	
-	
-	private static HashMap getSortedToolChains(){
+*/
+
+	private static HashMap> getSortedToolChains(){
 		if(fSortedToolChains == null){
 			fSortedToolChains = getSortedElements(ManagedBuildManager.getExtensionToolChainMap().values());
 		}
@@ -4357,20 +4336,19 @@ public class ManagedBuildManager extends AbstractCExtension {
 			list.add(p);
 			p.setIdenticalList(list);
 		}
-		
+
 		for(Iterator iter = map.values().iterator(); iter.hasNext();){
 			Collections.sort((List)iter.next());
 		}
 		return map;
 	}
-	
+
 	public static IToolChain[] getRealToolChains(){
-		HashMap map = getSortedToolChains();
+		HashMap> map = getSortedToolChains();
 		IToolChain tcs[] = new ToolChain[map.size()];
 		int i = 0;
-		for(Iterator iter = map.values().iterator(); iter.hasNext();){
-			List list = (List)iter.next();
-			tcs[i++] = (ToolChain)list.get(0);
+		for (List list : map.values()) {
+			tcs[i++] = list.get(0);
 		}
 		return tcs;
 	}
@@ -4396,7 +4374,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return bs;
 	}
-	
+
 	public static IBuilder getRealBuilder(IBuilder builder){
 		IBuilder extBuilder = builder;
 		IBuilder realBuilder = null;
@@ -4407,11 +4385,10 @@ public class ManagedBuildManager extends AbstractCExtension {
 			if(list.size() == 0){
 				realBuilder = extBuilder;
 			} else {
-				IBuilder[] realBs = getRealBuilders();
-				for(int i = 0; i < realBs.length; i++){
-					List rList = findIdenticalElements((Builder)realBs[i], fBuilderSorter);
+				for (IBuilder realBldr : getRealBuilders()) {
+					List rList = findIdenticalElements((Builder)realBldr, fBuilderSorter);
 					if(rList == list){
-						realBuilder = realBs[i];
+						realBuilder = realBldr;
 						break;
 					}
 				}
@@ -4434,11 +4411,10 @@ public class ManagedBuildManager extends AbstractCExtension {
 			if(list.size() == 0){
 				realTool = extTool;
 			} else {
-				ITool[] realTs = getRealTools();
-				for(int i = 0; i < realTs.length; i++){
-					List rList = findIdenticalElements((Tool)realTs[i], fToolSorter);
+				for (ITool realT : getRealTools()) {
+					List rList = findIdenticalElements((Tool)realT, fToolSorter);
 					if(rList == list){
-						realTool = realTs[i];
+						realTool = realT;
 						break;
 					}
 				}
@@ -4448,7 +4424,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 		}
 		return realTool;
 	}
-	
+
 	public static IToolChain getExtensionToolChain(IToolChain tc){
 		IToolChain extTc = tc;
 		for(;extTc != null && !extTc.isExtensionElement(); extTc= extTc.getSuperClass());
@@ -4457,19 +4433,18 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 	public static IToolChain getRealToolChain(IToolChain tc){
 		IToolChain extTc = tc;
-		IToolChain realTc = null;
+		IToolChain realToolChain = null;
 		for(;extTc != null && !extTc.isExtensionElement(); extTc= extTc.getSuperClass());
 
 		if(extTc != null){
 			List list = findIdenticalElements((ToolChain)extTc, fToolChainSorter);
 			if(list.size() == 0){
-				realTc = extTc;
+				realToolChain = extTc;
 			} else {
-				IToolChain[] realTcs = getRealToolChains();
-				for(int i = 0; i < realTcs.length; i++){
-					List rList = findIdenticalElements((ToolChain)realTcs[i], fToolChainSorter);
+				for (IToolChain realTc : getRealToolChains()) {
+					List rList = findIdenticalElements((ToolChain)realTc, fToolChainSorter);
 					if(rList == list){
-						realTc = realTcs[i];
+						realToolChain = realTc;
 						break;
 					}
 				}
@@ -4477,9 +4452,9 @@ public class ManagedBuildManager extends AbstractCExtension {
 		} else {
 			//TODO:
 		}
-		return realTc;
+		return realToolChain;
 	}
-	
+
 	public static IToolChain[] findIdenticalToolChains(IToolChain tc){
 		List list = findIdenticalElements((ToolChain)tc, fToolChainSorter);
 		return (ToolChain[])list.toArray(new ToolChain[list.size()]);
@@ -4500,17 +4475,16 @@ public class ManagedBuildManager extends AbstractCExtension {
 	}
 
 	public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue, boolean supportedPropsOnly){
-		HashMap all = getSortedToolChains();
+		HashMap> all = getSortedToolChains();
 		List result = new ArrayList();
-		for(Iterator iter = all.values().iterator(); iter.hasNext();){
-			List list = (List)iter.next();
+		for (List list : all.values()) {
 			IToolChain tc = findToolChain(list, propertyType, propertyValue, supportedPropsOnly);
 			if(tc != null)
 				result.add(tc);
 		}
 		return (IToolChain[])result.toArray(new ToolChain[result.size()]);
 	}
-	
+
 	public static void resortToolChains(){
 		fSortedToolChains = null;
 		getSortedToolChains();
@@ -4525,34 +4499,34 @@ public class ManagedBuildManager extends AbstractCExtension {
 		fSortedBuilders = null;
 		getSortedBuilders();
 	}
-	
-	private static IToolChain findToolChain(List list, String propertyType, String propertyValue, boolean supportedOnly){
+
+	private static IToolChain findToolChain(List list, String propertyType, String propertyValue, boolean supportedOnly){
 		ToolChain bestMatch = null;
 		IConfiguration cfg = null;
 		IProjectType type = null;
 		boolean valueSupported = false;
 
 		for(int i = 0; i < list.size(); i++){
-			ToolChain tc = (ToolChain)list.get(i);
+			ToolChain tc = list.get(i);
 			if(tc.supportsValue(propertyType, propertyValue)){
 				valueSupported = true;
 			} else if (valueSupported){
 				continue;
 			}
-			
+
 			if(!tc.supportsBuild(true))
 				return null;
-			
+
 			if(bestMatch == null && valueSupported)
 				bestMatch = tc;
-			
+
 			IConfiguration tcCfg = tc.getParent();
 			if(tcCfg != null){
 				if(cfg == null && valueSupported){
 					bestMatch = tc;
 					cfg = tcCfg;
 				}
-				
+
 				IBuildObjectProperties props =tcCfg.getBuildProperties();
 				IBuildProperty prop = props.getProperty(propertyType);
 				if(valueSupported && prop != null && propertyValue.equals(prop.getValue().getId())){
@@ -4567,7 +4541,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 						bestMatch = tc;
 					}
 					props = tcType.getBuildProperties();
-					prop = props.getProperty(propertyType); 
+					prop = props.getProperty(propertyType);
 					if(prop != null && propertyValue.equals(prop.getValue().getId())){
 						bestMatch = tc;
 						if(valueSupported){
@@ -4578,7 +4552,7 @@ public class ManagedBuildManager extends AbstractCExtension {
 				}
 			}
 		}
-		
+
 		if(valueSupported || ! supportedOnly)
 			return bestMatch;
 		return null;
@@ -4597,13 +4571,13 @@ public class ManagedBuildManager extends AbstractCExtension {
 
 		return list;
 	}
-	
-	
-	
+
+
+
 	public static IBuildPropertyManager getBuildPropertyManager(){
 		return BuildPropertyManager.getInstance();
 	}
-	
+
 	/**
 	 * Returns the configurations referenced by this configuration.
 	 * Returns an empty array if there are no referenced configurations.
@@ -4616,8 +4590,8 @@ public class ManagedBuildManager extends AbstractCExtension {
 		if(cfgDes != null){
 			ICConfigurationDescription[] descs= CoreModelUtil.getReferencedConfigurationDescriptions(cfgDes, false);
 			List result = new ArrayList();
-			for(int i=0; i