{"record":{"id":"aa65d9c8c1217142","repo":"flowable/flowable-engine","slug":"provided-token-date-is-null","errorCode":null,"errorMessage":"Provided token date is null","messagePattern":"Provided token date is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java","lineNumber":92,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Provided ids is null\");\n        }\n        this.ids = ids;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenValue(String tokenValue) {\n        if (tokenValue == null) {\n            throw new FlowableIllegalArgumentException(\"Provided token value is null\");\n        }\n        this.tokenValue = tokenValue;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenDate(Date tokenDate) {\n        if (tokenDate == null) {\n            throw new FlowableIllegalArgumentException(\"Provided token date is null\");\n        }\n        this.tokenDate = tokenDate;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenDateBefore(Date tokenDateBefore) {\n        if (tokenDateBefore == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tokenDateBefore is null\");\n        }\n        this.tokenDateBefore = tokenDateBefore;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenDateAfter(Date tokenDateAfter) {\n        if (tokenDateAfter == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tokenDateAfter is null\");","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java#L74-L110","documentation":"Flowable's TokenQueryImpl.tokenDate(Date tokenDate) throws FlowableIllegalArgumentException when the tokenDate argument is null. An exact-match date criterion must be non-null to be bound as a query parameter. The validation runs inside the fluent method, before any database access.","triggerScenarios":"Calling tokenDate(null) on a TokenQuery, e.g. when a timestamp parsed from a request or configuration was null because parsing failed or the field was absent.","commonSituations":"Filtering tokens by creation date where the date comes from optional request parameters; date fields lost in JSON deserialization; timezone/parsing utilities returning null on failure.","solutions":["Parse and validate the date before calling tokenDate, rejecting invalid input in your own layer","Use tokenDateBefore/tokenDateAfter for range filtering, applying them only when non-null","Omit the criterion when the date is absent to query without a date filter"],"exampleFix":"// before\nTokenQuery query = identityService.createTokenQuery().tokenDate(date);\n// after\nTokenQuery query = identityService.createTokenQuery();\nif (date != null) {\n    query.tokenDate(date);\n} else {\n    // handle missing date input\n}","handlingStrategy":"validation","validationCode":"if (tokenDate == null) { throw new IllegalArgumentException(\"tokenDate must not be null before tokenDate()\"); }","typeGuard":"boolean hasDate(Date d) { return d != null; }","tryCatchPattern":"try { query.tokenDate(date); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid token query: {}\", e.getMessage()); }","preventionTips":["Parse dates defensively and reject null/failed parses in your own layer","Use range filters conditionally instead of passing null exact-match dates","Ensure date fields have defaults when deserializing request payloads"],"tags":["flowable","idm","query","token","date","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}