Skip to content

Commit 3c69653

Browse files
committed
First fix enums from using reflection
1 parent be05f06 commit 3c69653

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

jooby/src/main/java/io/jooby/internal/ValueInjector.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ public static boolean isSimple(Class rawType, Type type) {
250250
if (FileUpload.class == rawType) {
251251
return true;
252252
}
253+
if (rawType.isEnum()) {
254+
return true;
255+
}
253256
/**********************************************************************************************
254257
* Static method: valueOf
255258
* ********************************************************************************************
@@ -337,6 +340,9 @@ private static Object value(Value value, Class rawType, Type type)
337340
}
338341
throw new TypeMismatchException(value.name(), FileUpload.class);
339342
}
343+
if (rawType.isEnum()) {
344+
return Enum.valueOf(rawType, value.get(0).value());
345+
}
340346
/**********************************************************************************************
341347
* Static method: valueOf
342348
* ********************************************************************************************

0 commit comments

Comments
 (0)