Bug 14844 - NPE creating binary projects
Summary: NPE creating binary projects
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-29 10:43 EDT by Tod Creasey CLA
Modified: 2002-05-14 08:55 EDT (History)
0 users

See Also:


Attachments
log file (10.06 KB, text/plain)
2002-04-29 10:45 EDT, Tod Creasey CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2002-04-29 10:43:59 EDT
Build 20020425

When I set up a new workbench for running Eclipse I got the Null Pointer
Exception below

STEPS
1) Load org.eclipse.ui from the repository
2) Import all of the other plugins in Eclipse using the PDE plugin import
wizard.

I had auto build on and at one point during the build I got the following
exception (see attached log)
Comment 1 Tod Creasey CLA 2002-04-29 10:45:47 EDT
Created attachment 719 [details]
log file
Comment 2 Kent Johnson CLA 2002-04-30 13:22:06 EDT
Could on reproduce on Sun's VM 1.3.1. Tod was using IBM's 1.3.1 which we have 
seen produce a few NPE that are very suspect.

As for a NPE in SimpleLookupTable.rehash()... this code is unchanged in 2 
months:

private void rehash() {
	SimpleLookupTable newLookupTable = new SimpleLookupTable(elementSize);
	Object currentKey;
	for (int i = keyTable.length; --i >= 0;)
		if ((currentKey = keyTable[i]) != null)
			newLookupTable.put(currentKey, valueTable[i]);

	this.keyTable = newLookupTable.keyTable;
	this.valueTable = newLookupTable.valueTable;
	this.elementSize = newLookupTable.elementSize;
	this.threshold = newLookupTable.threshold;
}

And was called from:

public Object put(Object key, Object value) {
	int length = keyTable.length;
	int index = (key.hashCode() & 0x7FFFFFFF) % length;
	Object currentKey;
	while ((currentKey = keyTable[index]) != null) {
		if (currentKey.equals(key)) return valueTable[index] = value;
		if (++index == length) index = 0;
	}
	keyTable[index] = key;
	valueTable[index] = value;

	// assumes the threshold is never equal to the size of the table
	if (++elementSize > threshold) rehash();
	return value;
}

Cannot see how a NPE is possible.