LUCENE-7595: Fix bug with RamUsageTester incorrectly handling Iterables outside Java Runtime

This commit is contained in:
Uwe Schindler 2016-12-29 20:31:47 +01:00
parent 3f24fd81c8
commit db9190db93
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ public final class RamUsageTester {
}
boolean needsReflection = true;
if (Constants.JRE_IS_MINIMUM_JAVA9) {
if (Constants.JRE_IS_MINIMUM_JAVA9 && obClazz.getName().startsWith("java.")) {
// Java 9: Best guess for some known types, as we cannot precisely look into runtime classes:
final ToLongFunction<Object> func = SIMPLE_TYPES.get(obClazz);
if (func != null) { // some simple type like String where the size is easy to get from public properties