{"record":{"id":"85350057eabf2c70","repo":"flowable/flowable-engine","slug":"max-priority-is-null-853500","errorCode":null,"errorMessage":"Max Priority is null","messagePattern":"Max Priority is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":326,"sourceCode":"    }\n\n    @Override\n    public TaskQuery taskMinPriority(Integer minPriority) {\n        if (minPriority == null) {\n            throw new ActivitiIllegalArgumentException(\"Min Priority is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.minPriority = minPriority;\n        } else {\n            this.minPriority = minPriority;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskMaxPriority(Integer maxPriority) {\n        if (maxPriority == null) {\n            throw new ActivitiIllegalArgumentException(\"Max Priority is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.maxPriority = maxPriority;\n        } else {\n            this.maxPriority = maxPriority;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskAssignee(String assignee) {\n        if (assignee == null) {\n            throw new ActivitiIllegalArgumentException(\"Assignee is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.assignee = assignee;\n        } else {\n            this.assignee = assignee;","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L308-L344","documentation":"Thrown by TaskQueryImpl.taskMaxPriority(Integer) when the maxPriority argument is null. Like all Flowable/Activiti 5 query setters, it validates input up front: a null max priority is not a meaningful filter and would corrupt the generated query, so ActivitiIllegalArgumentException is raised immediately.","triggerScenarios":"Calling taskQuery.taskMaxPriority(null), or feeding a null Integer obtained from an unset request parameter, missing map key, or incomplete filter object into taskMaxPriority.","commonSituations":"Optional 'maxPriority' REST parameter not sent by the client; filter objects deserialized from JSON where the field is absent; copying values between query objects where the source field was never set.","solutions":["Pass a concrete Integer (e.g. taskMaxPriority(100)).","Guard the call: only invoke taskMaxPriority when the value is non-null.","Initialize the filter field with a default such as Integer.MAX_VALUE when it represents 'no upper bound'.","Validate/normalize the incoming DTO before building the query."],"exampleFix":"// before\nquery.taskMaxPriority(filter.getMaxPriority());\n\n// after\nif (filter.getMaxPriority() != null) {\n    query.taskMaxPriority(filter.getMaxPriority());\n}","handlingStrategy":"validation","validationCode":"if (maxPriority != null) {\n    query.taskMaxPriority(maxPriority);\n}","typeGuard":"boolean hasMaxPriority(Integer v) { return v != null; }","tryCatchPattern":"try {\n    query.taskMaxPriority(maxPriority);\n} catch (ActivitiIllegalArgumentException e) {\n    throw new BadRequestException(\"Invalid maxPriority: \" + e.getMessage());\n}","preventionTips":["Use Integer.MAX_VALUE as 'no upper bound' instead of null.","Guard optional filters with null checks.","Normalize request parameters before query construction."],"tags":["java","flowable","task-query","null-argument","validation"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}