8214795: Add safety check to dynalink inner class lookup

Reviewed-by: sundar, attila
This commit is contained in:
Hannes Wallnöfer 2018-12-05 19:17:22 +01:00
parent 055ed2b789
commit 74fa722567

View File

@ -216,7 +216,10 @@ class AccessibleMembersLookup {
// were not yet loaded, they'll only get loaded in a non-resolved state; no static initializers for
// them will trigger just by doing this.
// Don't overwrite an inner class with an inherited inner class with the same name.
innerClasses.putIfAbsent(innerClass.getSimpleName(), innerClass);
Class<?> previousClass = innerClasses.get(innerClass.getSimpleName());
if (previousClass == null || previousClass.getDeclaringClass().isAssignableFrom(innerClass.getDeclaringClass())) {
innerClasses.put(innerClass.getSimpleName(), innerClass);
}
}
} else {
searchSuperTypes = true;