From 1d9fff59af0054f432902039aed42b34cdc6dde1 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Thu, 7 Nov 2024 17:24:36 -0800 Subject: [PATCH] Minor straightening of code post merge --- .../jackson/databind/util/EnumValues.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/util/EnumValues.java b/src/main/java/com/fasterxml/jackson/databind/util/EnumValues.java index 3c9603c73d..8e78bf5063 100644 --- a/src/main/java/com/fasterxml/jackson/databind/util/EnumValues.java +++ b/src/main/java/com/fasterxml/jackson/databind/util/EnumValues.java @@ -244,21 +244,18 @@ protected static Enum[] _enumConstants(Class enumCls) { } protected static String _findNameToUse(String explicitName, String otherName, boolean toLowerCase) { - String name; // If explicitly named, like @JsonProperty-annotated, then use it if (explicitName != null) { - name = explicitName; - } else { - name = otherName; - // [databind#4788] Since 2.18.2 : EnumFeature.WRITE_ENUMS_TO_LOWERCASE should not - // override @JsonProperty values - if (toLowerCase) { - name = name.toLowerCase(); - } + return explicitName; + } + // [databind#4788] Since 2.18.2 : EnumFeature.WRITE_ENUMS_TO_LOWERCASE should not + // override @JsonProperty values + if (toLowerCase) { + return otherName.toLowerCase(); } - return name; + return otherName; } - + /* /********************************************************************** /* Public API