Summary: | NPE when exiting Eclipse | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Andre Weinand <andre_weinand> | ||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | daniel_megert, debbie_wilson, dj.houghton, eclipse | ||||||
Version: | 2.1 | ||||||||
Target Milestone: | 2.1 RC4 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows 2000 | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Andre Weinand
2003-03-21 10:28:17 EST
In this code, IIndex[] selectedIndexes = indexSelector.getIndexes(); SimpleLookupTable knownPaths = new SimpleLookupTable(); for (int i = 0, max = selectedIndexes.length; i < max; i++) { String path = selectedIndexes[i].getIndexFile().getAbsolutePath(); knownPaths.put(path, path); } getIndexes() can return a collection which contains null entries, if some index needs to be created. So a fix would be to add a null check in the for loop. IIndex[] selectedIndexes = indexSelector.getIndexes(); SimpleLookupTable knownPaths = new SimpleLookupTable(); for (int i = 0, max = selectedIndexes.length; i < max; i++) { IIndex selectedIndex = selectedIndexes[i]; if (selectedIndex != null) { String path = selectedIndex.getIndexFile().getAbsolutePath(); knownPaths.put(path, path); } } Created attachment 4289 [details]
Patch for this NPE
Applying this patch fixed the problem on my machine.
Null indexes could be computed incorrectly as a consequence of fix for bug 35306. This is a regression. Need to be fixed for RC4 (null indexes are simply to be ignored). Created attachment 4290 [details]
Better fix for this issue
#getIndexes() must not answer null indexes, since clients do not expect this.
Also the problem may occur elsewhere than during shutdown (whenever a search
job is running without waiting for indexing to have finished).
Patch verified. +1 Is this a regression of Bug 33462? I am seeing it in RC3b. No, this is a different problem. In fact, this is a consequence of fixing bug 35306. Fix is not yet released (that's why you're seeing it in RC3b) *** Bug 35608 has been marked as a duplicate of this bug. *** *** Bug 35642 has been marked as a duplicate of this bug. *** Fix released for integration Verified. |