HashtableOfObject changes:
- Added extra checks for negative/too large table size values.
- Table can be created with size up to Integer.MAX_VALUE - 2 (before it
was Integer.MAX_VALUE / 1.75) and will throw OOME with specific error
information if table can't be increased in size anymore.
- rehash() uses now adoptive size calculation (not just doubles the
array size), and will throw OOME with specific error information if
table can't be increased in size anymore.
- added unit tests for expected possible HashtableOfObject sizes.
Related caller changes:
- IndexManager.saveIndexes() catches additionally
NegativeArraySizeException & OutOfMemoryError if index write fails, and
logs failed index name.
- DiskIndex.readCategoryTable() report IO error in case
HashtableOfObject reports NegativeArraySizeException or
OutOfMemoryError.
- DiskIndex.mergeWith() uses nio API for index move/delete and report IO
errors now.
- PatternSearchJob/AddJarFileToIndex/AddJrtToIndex report IO errors now.
Change-Id: I11255589705ea03fdbc08b6a452b211aca013c62
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/189648
Tested-by: JDT Bot <jdt-bot@eclipse.org>