DATACMNS-1278 - Make sure that SimpleTypeHolder always treats enums as simple.

We now explicitly check for an enum type in SimpleTypeHolder.isSimpleType(…) and resort to true immediately. Before that an enum implementing an interface could have seen a false for the actual enum type in case the interface type had been checked first and (correctly) produced a false. In the check for the actual enum type, depending on the iteration order through the cached values we could've hit the cached false for the interface or the cached true value for Enum.
This commit is contained in:
Oliver Gierke
2018-03-12 10:47:26 +01:00
parent 91c7d1b199
commit 0f174f6867
2 changed files with 14 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ public class SimpleTypeHolder {
Map<Class<?>, Boolean> localSimpleTypes = this.simpleTypes;
Boolean isSimpleType = localSimpleTypes.get(type);
if (Object.class.equals(type)) {
if (Object.class.equals(type) || Enum.class.isAssignableFrom(type)) {
return true;
}