Remove Integer/Enum conversion, it wasn't necessary.
This commit is contained in:
parent
512cb0f608
commit
253816bd8c
2 changed files with 1 additions and 7 deletions
2
pom.xml
2
pom.xml
|
@ -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>
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue