This repository was archived by the owner on Dec 22, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/main/java/com/therandomlabs/randomlib/config Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -487,9 +487,13 @@ Property deserialize(Configuration config) throws IllegalAccessException {
487487 return property ;
488488 }
489489
490+ //Ignore underscores when matching enums
491+ //Hopefully this will never cause issues
490492 if (!isArray ) {
493+ final String value = StringUtils .remove (property .getString (), '_' );
494+
491495 for (Enum element : enumConstants ) {
492- if (element .name ().equalsIgnoreCase (property . getString () )) {
496+ if (StringUtils . remove ( element .name (), '_' ) .equalsIgnoreCase (value )) {
493497 field .set (null , element );
494498 return property ;
495499 }
@@ -503,8 +507,10 @@ Property deserialize(Configuration config) throws IllegalAccessException {
503507 final List <Object > enumValues = new ArrayList <>(values .length );
504508
505509 for (String value : values ) {
510+ value = StringUtils .remove (value , '_' );
511+
506512 for (Enum element : enumConstants ) {
507- if (element .name ().equalsIgnoreCase (value )) {
513+ if (StringUtils . remove ( element .name (), '_' ).equalsIgnoreCase (value )) {
508514 enumValues .add (element );
509515 break ;
510516 }
You can’t perform that action at this time.
0 commit comments