From 253816bd8c894217dd93d2a8e28d8f36715db4a1 Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Wed, 9 Aug 2017 11:49:38 -0400 Subject: [PATCH] Remove Integer/Enum conversion, it wasn't necessary. --- pom.xml | 2 +- .../net/helenus/core/reflect/MapperInvocationHandler.java | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 7059b65..bdc91e5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 net.helenus helenus-core - 2.0.11-SNAPSHOT + 2.0.12-SNAPSHOT jar helenus diff --git a/src/main/java/net/helenus/core/reflect/MapperInvocationHandler.java b/src/main/java/net/helenus/core/reflect/MapperInvocationHandler.java index b77ba50..467c857 100644 --- a/src/main/java/net/helenus/core/reflect/MapperInvocationHandler.java +++ b/src/main/java/net/helenus/core/reflect/MapperInvocationHandler.java @@ -105,12 +105,6 @@ public class MapperInvocationHandler implements InvocationHandler { 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;