Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331735

Summary: crash of project explorer and property pages, indexing error too
Product: z_Archived Reporter: Edwin van den Oetelaar <edwin>
Component: AutotoolsAssignee: Jeff Johnston <jjohnstn>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 0.7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Edwin van den Oetelaar CLA 2010-12-02 18:22:04 EST
Build Identifier: Version: 3.5.2 Build id: M20100211-1343

Could not acquire children from extension: org.eclipse.ui.navigator.resourceContent

An unexpected exception was thrown.

at org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager.cloneCfg(AutotoolsConfigurationManager.java:275)
	at org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsOptionValueHandler.handleValue(AutotoolsOptionValueHandler.java:80)
	at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.performValueHandlerEvent(ManagedBuildManager.java:3436)

Traced it down to around line 275 of /org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java

	// Otherwise, try and find the old id to copy the configuration from
		// or punt if not found
		Map <String, IAConfiguration> savedList = getSavedConfigs(p);
		IAConfiguration oldCfg = savedList.get(oldId); // PROBLEM, savedList==null getSavedConfigs() returns 'null' of .autotools is not there!
		if (oldCfg != null) {
			IAConfiguration newCfg = oldCfg.copy(cfgd.getId());
			tmpList.put(cfgd.getId(), newCfg);
			// Check to see if the new configuration is already stored as part of the project description.
			// If yes, it should already be saved.  This can occur if the configuration was added as part of
			// another CDT Property page and the Autotools Property page was never opened.
			if (CoreModel.getDefault().getProjectDescription(p).getConfigurationById(newId) != null) {
				addConfiguration(p, newCfg);
				return true;
			}
		}

The solution could be to check for null from getSavedConfigs() and handle accordingly.


Reproducible: Always

Steps to Reproduce:
1. remove the .autotools file
2. close IDE
3. start IDE 
4. witness a An internal error occurred during: "Initialize Indexing".
Comment 1 Jeff Johnston CLA 2010-12-10 16:24:56 EST
A patch has been made to check for null as suggested.  The failure no longer occurs.  Removing the .autotools file is not recommended and will result in undefined behaviour.  It is used to keep Autotools configuration settings and needs to be kept in sync with CDT configurations (e.g. copying a CDT configuration needs to clone its Autotools configuration settings that were made).