Remove Integer/Enum conversion, it wasn't necessary.

This commit is contained in:
Greg Burd 2017-08-09 11:49:38 -04:00
parent 512cb0f608
commit 253816bd8c
2 changed files with 1 additions and 7 deletions

View file

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.helenus</groupId> <groupId>net.helenus</groupId>
<artifactId>helenus-core</artifactId> <artifactId>helenus-core</artifactId>
<version>2.0.11-SNAPSHOT</version> <version>2.0.12-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>helenus</name> <name>helenus</name>

View file

@ -105,12 +105,6 @@ public class MapperInvocationHandler<E> implements InvocationHandler {
throw new HelenusException("missing default type for enum user type " + returnType); throw new HelenusException("missing default type for enum user type " + returnType);
} }
} else if (returnType.isEnum() && (value.getClass() == Integer.class || value.getClass() == int.class)) {
try {
value = Class.forName(returnType.getName()).getEnumConstants()[(Integer) value];
} catch (ArrayIndexOutOfBoundsException e) {
throw new IllegalArgumentException("invalid ordinal " + value + " for enum type " + returnType.getSimpleName());
}
} }
return value; return value;