{"record":{"id":"2e10d13678cbccc8","repo":"flowable/flowable-engine","slug":"provided-date-is-null-2e10d1","errorCode":null,"errorMessage":"Provided date is null","messagePattern":"Provided date is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java","lineNumber":495,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Cannot combine onlyMessages() with onlyExternalWorkers() in the same query\");\n        }\n\n        if (onlyTimers) {\n            throw new FlowableIllegalArgumentException(\"Cannot combine onlyTimers() with onlyExternalWorkers() in the same query\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.onlyExternalWorkers = true;\n        } else {\n            this.onlyExternalWorkers = true;\n        }\n        return this;\n    }\n\n    @Override\n    public SuspendedJobQueryImpl duedateHigherThan(Date date) {\n        if (date == null) {\n            throw new FlowableIllegalArgumentException(\"Provided date is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.duedateHigherThan = date;\n        } else {\n            this.duedateHigherThan = date;\n        }\n        return this;\n    }\n\n    @Override\n    public SuspendedJobQueryImpl duedateLowerThan(Date date) {\n        if (date == null) {\n            throw new FlowableIllegalArgumentException(\"Provided date is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.duedateLowerThan = date;\n        } else {\n            this.duedateLowerThan = date;","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java#L477-L513","documentation":"duedateHigherThan(Date) filters suspended jobs whose due date is after the given date. The library throws FlowableIllegalArgumentException when the argument is null because a null date cannot express a comparison boundary and would silently corrupt the query. This guard rejects the bad input immediately at builder time.","triggerScenarios":"Calling suspendedJobQuery().duedateHigherThan(someDate) where someDate is null — e.g. a Date field/variable that was never assigned, or an optional request parameter that was not defaulted.","commonSituations":"Passing a parsed date that failed to parse, reading a nullable config/DTO field for the 'due after' window, or Java deserialization leaving the Date null. Also happens with method-chaining on a value returned by a map lookup.","solutions":["Pass a non-null Date; if the filter is optional, skip calling duedateHigherThan entirely when the date is null.","Default the date to a sensible value (e.g. new Date(0) or start of day) before building the query.","Fix the upstream parsing/assignment that left the Date null."],"exampleFix":"// before\nquery.duedateHigherThan(optionalDate); // optionalDate may be null\n// after\nif (optionalDate != null) {\n    query.duedateHigherThan(optionalDate);\n}","handlingStrategy":"validation","validationCode":"if (date == null) {\n    throw new IllegalArgumentException(\"duedateHigherThan requires a non-null date\");\n}","typeGuard":"boolean isApplicable(Date d) { return d != null; }","tryCatchPattern":"try {\n    query.duedateHigherThan(date);\n} catch (FlowableIllegalArgumentException e) {\n    // omit the optional date filter or supply a default\n    query.duedateHigherThan(new Date(0));\n}","preventionTips":["Use Optional<Date> for optional bounds and only apply the filter when present.","Never pass Date values straight from nullable DTO/config fields into the query builder.","Check date-parsing helpers for null-on-failure behavior before using their result."],"tags":["flowable","job-query","null-date","illegal-argument"],"backgroundTag":"null-argument","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"}