Skip to content

Commit

Permalink
feat: apply WRITE_ENUMS_TO_LOWERCASE despite EnumNamingStrategy (#4043)
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy authored Jul 18, 2023
1 parent d5c8ecc commit 8e56c2a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public static EnumValues constructUsingEnumNamingStrategy(MapperConfig<?> config
{
// prepare data
final AnnotationIntrospector ai = config.getAnnotationIntrospector();
final boolean useLowerCase = config.isEnabled(EnumFeature.WRITE_ENUMS_TO_LOWERCASE);
final Class<?> enumCls0 = annotatedClass.getRawType();
final Class<Enum<?>> enumCls = _enumClass(enumCls0);
final Enum<?>[] enumConstants = _enumConstants(enumCls0);
Expand All @@ -187,6 +188,9 @@ public static EnumValues constructUsingEnumNamingStrategy(MapperConfig<?> config
if (name == null) {
name = namingStrategy.convertEnumToExternalName(enumValue.name());
}
if (useLowerCase) {
name = name.toLowerCase();
}
textual[i] = config.compileString(name);
}
return construct(enumCls, textual);
Expand Down

0 comments on commit 8e56c2a

Please sign in to comment.