[grid] Avoid a possible NPE in the AnnotatedConfig
The docs for `Class.getSuperClass` say it may return `null` " If this
{@code Class} represents either the Object class, an interface, a
primitive type, or void, then null is returned" Best avoid
accidentally throwing a NullPointerException.
@@ -133,7 +133,7 @@ private String getSingleValue(Object value) {
.forEach(toSet::addLast);
Class<?> toAdd = clazz.getSuperclass();
- if (!Object.class.equals(toAdd) && !seen.contains(toAdd)) {
+ if (toAdd != null && !Object.class.equals(toAdd) && !seen.contains(toAdd)) {
toVisit.add(toAdd);
}
Arrays.stream(clazz.getInterfaces())
