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

Bug 13038

Summary: NPE in FileContentProvider.getInstallSizeFor
Product: [Eclipse Project] Platform Reporter: Dejan Glozic <dejan>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: Christophe Elek <celek>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Dejan Glozic CLA 2002-04-08 17:29:06 EDT
The logic in FileContentProvider.getInstallSizeFor allows a combination whereby 
a null entry array is accessed:

		if ((pluginEntries == null || pluginEntries.length == 0)
			&& (nonPluginEntries == null || nonPluginEntries.length 
== 0)) {
			return ContentEntryModel.UNKNOWN_SIZE;
		}

In the code above, is one pluginEntires !=null but nonPluginEntires==null, the 
code will not return and a NPE will be generated.
Comment 1 Christophe Elek CLA 2002-04-15 21:02:53 EDT
replaced with 

if (pluginEntries == null || nonPluginEntries == null)
	return ContentEntryModel.UNKNOWN_SIZE;