diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/constant/BuiltinFormats.java b/easyexcel-core/src/main/java/com/alibaba/excel/constant/BuiltinFormats.java index 7e071af5..b6fb8e48 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/constant/BuiltinFormats.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/constant/BuiltinFormats.java @@ -21,6 +21,8 @@ import com.alibaba.excel.util.StringUtils; **/ public class BuiltinFormats { + private static final String RESERVED = "reserved-"; + public static short GENERAL = 0; public static final String[] BUILTIN_FORMATS_ALL_LANGUAGES = { @@ -491,7 +493,7 @@ public class BuiltinFormats { } // In other cases, give priority to using the externally provided format - if (!StringUtils.isEmpty(defaultFormat) && !defaultFormat.startsWith("reserved-")) { + if (!StringUtils.isEmpty(defaultFormat) && !defaultFormat.startsWith(RESERVED)) { return defaultFormat; }