{"record":{"id":"451eaa9c015ac70f","repo":"flowable/flowable-engine","slug":"using-joda-time-localdate-has-been-deprecated-and-451eaa","errorCode":null,"errorMessage":"Using Joda-Time LocalDate has been deprecated and will be removed in a future version.","messagePattern":"Using Joda-Time LocalDate has been deprecated and will be removed in a future version\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/util/DateUtil.java","lineNumber":36,"sourceCode":"import org.flowable.common.engine.impl.joda.JodaDeprecationLogger;\nimport org.joda.time.LocalDate;\nimport org.joda.time.format.DateTimeFormat;\nimport org.joda.time.format.DateTimeFormatter;\n\n/**\n * @author Yvo Swillens\n */\npublic class DateUtil {\n\n    public static Date toDate(Object dateObject) {\n        if (dateObject == null) {\n            throw new IllegalArgumentException(\"date object cannot be empty\");\n        }\n\n        if (dateObject instanceof Date) {\n            return (Date) dateObject;\n        } else if (dateObject instanceof LocalDate) {\n            JodaDeprecationLogger.LOGGER.warn(\"Using Joda-Time LocalDate has been deprecated and will be removed in a future version.\");\n            return ((LocalDate) dateObject).toDate();\n        } else if (dateObject instanceof java.time.LocalDate) {\n            return Date.from(((java.time.LocalDate) dateObject).atStartOfDay()\n                    .atZone(ZoneId.systemDefault())\n                    .toInstant());\n        } else {\n            DateTimeFormatter dtf = DateTimeFormat.forPattern(\"yyyy-MM-dd\");\n            LocalDate dateTime = dtf.parseLocalDate((String) dateObject);\n            return dateTime.toDate();\n        }\n    }\n\n    public static Date addDate(Object startDate, Object years, Object months, Object days) {\n        LocalDate currentDate = new LocalDate(startDate);\n        \n        currentDate = currentDate.plusYears(intValue(years));\n        currentDate = currentDate.plusMonths(intValue(months));\n        currentDate = currentDate.plusDays(intValue(days));","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/el/util/DateUtil.java#L18-L54","documentation":"A deprecation WARN from DateUtil.toDate: an org.joda.time.LocalDate object was supplied where a java.util.Date is needed; Flowable converts it via toDay().toDate(). Joda-Time support will be removed in a future Flowable version.","triggerScenarios":"Any DMN code path that calls DateUtil.toDate with a Joda LocalDate — e.g. date-typed decision table inputs or FEEL date functions receiving Joda values during decision execution.","commonSituations":"Applications still using Joda-Time alongside Flowable; variables persisted by older engine versions and read back as Joda types; utility code passing Joda dates into DMN expression evaluation.","solutions":["Convert the value to java.time.LocalDate or java.util.Date before passing it to DMN evaluation.","Migrate the owning codebase off Joda-Time (project is EOL since Java SE 8's java.time).","If Joda values come from persistence, update the variable mapping/serialization layer to java.time types."],"exampleFix":"// before\nObject value = org.joda.time.LocalDate.now();\nDate d = DateUtil.toDate(value);\n// after\nDate d = Date.from(java.time.LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant());","handlingStrategy":"type-guard","validationCode":"if (value instanceof org.joda.time.LocalDate) { value = ((org.joda.time.LocalDate) value).toDate(); }","typeGuard":"boolean isJodaLocalDate(Object v) { return v instanceof org.joda.time.LocalDate; }","tryCatchPattern":null,"preventionTips":["Convert Joda types to java.time at system boundaries","Search codebase for org.joda imports and schedule migration","Prefer java.util.Date or java.time.LocalDate for DMN inputs"],"tags":["dmn","deprecation","joda-time","date"],"backgroundTag":"deprecated-api-usage","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}