Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 13038 - NPE in FileContentProvider.getInstallSizeFor
Summary: NPE in FileContentProvider.getInstallSizeFor
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Christophe Elek CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-08 17:29 EDT by Dejan Glozic CLA
Modified: 2002-04-17 10:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;