From 4143b9847d74dc394bad436a8795843445c9f2dd Mon Sep 17 00:00:00 2001 From: Robinson Date: Mon, 4 Apr 2022 12:30:06 +0200 Subject: [PATCH] Fixed bug with ClassHierarchy w.r.t. arrays --- src/dorkbox/util/classes/ClassHierarchy.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/dorkbox/util/classes/ClassHierarchy.java b/src/dorkbox/util/classes/ClassHierarchy.java index 1b4efca..1a7c966 100644 --- a/src/dorkbox/util/classes/ClassHierarchy.java +++ b/src/dorkbox/util/classes/ClassHierarchy.java @@ -77,11 +77,11 @@ class ClassHierarchy { Class c; final boolean isArray = clazz.isArray(); - if (isArray) { - // have to add the original class to the front of the list - c = getArrayClass(clazz); - newList.add(c); + // have to add the original class to the front of the list + newList.add(clazz); + if (isArray) { + // super-types for an array ALSO must be an array. while (superTypesIterator.hasNext()) { c = superTypesIterator.next(); c = getArrayClass(c); @@ -92,9 +92,6 @@ class ClassHierarchy { } } else { - // have to add the original class to the front of the list - newList.add(clazz); - while (superTypesIterator.hasNext()) { c = superTypesIterator.next();