{"record":{"id":"271e431b210b4be1","repo":"flowable/flowable-engine","slug":"ids-are-null-271e43","errorCode":null,"errorMessage":"ids are null","messagePattern":"ids are null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":150,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new ActivitiIllegalArgumentException(\"id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new ActivitiIllegalArgumentException(\"ids are null\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionKey(String key) {\n        if (key == null) {\n            throw new ActivitiIllegalArgumentException(\"key is null\");\n        }\n        this.key = key;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionKeyLike(String keyLike) {\n        if (keyLike == null) {\n            throw new ActivitiIllegalArgumentException(\"keyLike is null\");","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java#L132-L168","documentation":"ProcessDefinitionQueryImpl.deploymentIds(Set<String>) throws ActivitiIllegalArgumentException 'ids are null' when the supplied set is null (an empty set is accepted). The engine needs a concrete collection to build the IN clause, so it rejects null up front. This is an argument contract check in the query builder.","triggerScenarios":"Calling ProcessDefinitionQuery.deploymentIds(null), e.g. when a collection variable was never initialized, a mapping function returned null instead of an empty set, or an optional bulk filter is forwarded unconditionally.","commonSituations":"Batch/report code building multi-deployment filters from configuration lists that are absent; Java 8 streams collector results assigned to null on error paths; deserialized DTOs with null set fields.","solutions":["Pass a non-null Set, e.g. new HashSet<>(Arrays.asList(\"dep1\",\"dep2\"))","If the filter is optional, only call deploymentIds when the set is non-null","Treat 'no filter' as an empty set only if the rest of the query logic supports it, otherwise omit the call","Catch ActivitiIllegalArgumentException to map it to a client validation error"],"exampleFix":"// before\nquery.deploymentIds(deploymentIdSet); // null when config missing\n// after\nif (deploymentIdSet != null && !deploymentIdSet.isEmpty()) {\n    query.deploymentIds(deploymentIdSet);\n}","handlingStrategy":"validation","validationCode":"if (deploymentIds == null) throw new IllegalArgumentException(\"deploymentIds set is required\");\nquery.deploymentIds(deploymentIds);","typeGuard":"boolean isNonEmptySet(Set<String> s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.deploymentIds(ids);\n} catch (ActivitiIllegalArgumentException e) {\n    if (e.getMessage().contains(\"ids are null\")) {\n        throw new BadRequestException(\"deploymentIds must not be null\");\n    }\n    throw e;\n}","preventionTips":["Initialize collections to empty sets rather than leaving fields null","Use Collections.emptySet() as the default for optional set filters","Null-check collection parameters before passing them to query builders","Ensure deserialized DTOs default set fields to empty collections"],"tags":["java","null-argument","query-builder","activiti","collection"],"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"}