{"record":{"id":"486b8cd3fa9ba795","repo":"flowable/flowable-engine","slug":"casedefinitionids-is-null","errorCode":null,"errorMessage":"caseDefinitionIds is null","messagePattern":"caseDefinitionIds is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java","lineNumber":85,"sourceCode":"\n    public CaseDefinitionQueryImpl(CommandContext commandContext) {\n        super(commandContext);\n    }\n\n    public CaseDefinitionQueryImpl(CommandExecutor commandExecutor) {\n        super(commandExecutor);\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionId(String caseDefinitionId) {\n        this.id = caseDefinitionId;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQuery caseDefinitionIds(Set<String> caseDefinitionIds) {\n        if (caseDefinitionIds == null) {\n            throw new FlowableIllegalArgumentException(\"caseDefinitionIds is null\");\n        } else if (caseDefinitionIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Empty caseDefinitionIds\");\n        }\n        this.ids = caseDefinitionIds;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionCategory(String category) {\n        if (category == null) {\n            throw new FlowableIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionCategoryLike(String categoryLike) {","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java#L67-L103","documentation":"Query-builder validation in CaseDefinitionQueryImpl.caseDefinitionIds: a null Set was passed as the id collection filter. Null is rejected because it would collide with the internal 'no filter' sentinel; use an empty query instead of null.","triggerScenarios":"Calling caseDefinitionQuery.caseDefinitionIds(null) to try to remove the filter or ignore it.","commonSituations":"Code that builds filter sets dynamically and passes through a null when the caller gave no filter; confusion between 'no filter' (simply don't call the method) and 'empty set'.","solutions":["Only call caseDefinitionIds when the set is non-null; otherwise skip the call to leave the filter unset","Coalesce null to an existing default set of ids"],"exampleFix":"// before\nquery.caseDefinitionIds(filter.getIds()); // may be null\n// after\nif (filter.getIds() != null) {\n    query.caseDefinitionIds(filter.getIds());\n}","handlingStrategy":"type-guard","validationCode":"if (ids == null) { ids = Collections.emptySet(); /* or skip the filter */ }","typeGuard":"boolean usableIds = ids != null && !ids.isEmpty();","tryCatchPattern":"try {\n    query.caseDefinitionIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    // drop the filter and retry the query without it\n}","preventionTips":["Never call filter setters with null; skip them instead","Wrap query building in a helper that checks each optional filter","Distinguish 'no filter' from 'filter with empty value' in your filter-building code"],"tags":["cmmn","query","null-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"}