{"record":{"id":"e16709185ababa46","repo":"apache/seatunnel","slug":"illegal-format-s-e16709","errorCode":null,"errorMessage":"Illegal format [%s]","messagePattern":"Illegal format \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/DateUtils.java","lineNumber":220,"sourceCode":"        private final String value;\n\n        Formatter(String value) {\n            this.value = value;\n        }\n\n        public String getValue() {\n            return value;\n        }\n\n        public static Formatter parse(String format) {\n            Formatter[] formatters = Formatter.values();\n            for (Formatter formatter : formatters) {\n                if (formatter.getValue().equals(format)) {\n                    return formatter;\n                }\n            }\n            String errorMsg = String.format(\"Illegal format [%s]\", format);\n            throw new IllegalArgumentException(errorMsg);\n        }\n    }\n}\n","sourceCodeStart":202,"sourceCodeEnd":224,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/DateUtils.java#L202-L224","documentation":"DateUtils.parse resolves a Formatter enum by exact match against the user-supplied date format string. If the format is not one of the supported enumerated formatters, it throws IllegalArgumentException 'Illegal format [x]'.","triggerScenarios":"Calling DateUtils.parse(value, format) with a format string that does not match any supported Formatter value (e.g. 'yyyy/MM/dd' when only 'yyyy-MM-dd'-style values are enumerated).","commonSituations":"A connector config sets date_format to an unsupported pattern; using a Java pattern that resembles but does not exactly equal an enum value; typos or slash vs dash separators.","solutions":["Configure one of the supported date formats from the DateUtils.Formatter enum","Verify exact spelling and separators of the format string","Extend the Formatter enum with the needed pattern if the format is legitimately required"],"exampleFix":"// before\ndate_format = \"yyyy/MM/dd\" // unsupported\n// after\ndate_format = \"yyyy-MM-dd\"","handlingStrategy":"validation","validationCode":"boolean ok = Arrays.stream(DateUtils.Formatter.values()).anyMatch(f -> f.getValue().equals(userFormat));","typeGuard":null,"tryCatchPattern":"try { return DateUtils.parse(value, format); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(\"Unsupported date_format: \" + format, e); }","preventionTips":["Use exactly the enumerated format values (watch dash vs slash separators)","Validate date_format options at config load time","Centralize allowed formats in a constant list shared with configs"],"tags":["date","format-parsing","argument-validation"],"backgroundTag":"invalid-date-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}