Summary: | NPE creating binary projects | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Tod Creasey <Tod_Creasey> | ||||
Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||
Status: | RESOLVED WORKSFORME | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P2 | ||||||
Version: | 2.0 | ||||||
Target Milestone: | 2.0 M6 | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Tod Creasey
2002-04-29 10:43:59 EDT
Created attachment 719 [details]
log file
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. |