{"record":{"id":"f9ef494909782764","repo":"flowable/flowable-engine","slug":"process-definition-keys-is-null-f9ef49","errorCode":null,"errorMessage":"Process definition keys is null","messagePattern":"Process definition keys is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java","lineNumber":175,"sourceCode":"\n    @Override\n    public ExecutionQuery processInstanceBusinessKey(String processInstanceBusinessKey, boolean includeChildExecutions) {\n        if (!includeChildExecutions) {\n            return processInstanceBusinessKey(processInstanceBusinessKey);\n        } else {\n            if (processInstanceBusinessKey == null) {\n                throw new ActivitiIllegalArgumentException(\"Business key is null\");\n            }\n            this.businessKey = processInstanceBusinessKey;\n            this.includeChildExecutionsWithBusinessKeyQuery = includeChildExecutions;\n            return this;\n        }\n    }\n\n    @Override\n    public ExecutionQuery processDefinitionKeys(Set<String> processDefinitionKeys) {\n        if (processDefinitionKeys == null) {\n            throw new ActivitiIllegalArgumentException(\"Process definition keys is null\");\n        }\n        this.processDefinitionKeys = processDefinitionKeys;\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl executionId(String executionId) {\n        if (executionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Execution id is null\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl activityId(String activityId) {\n        this.activityId = activityId;\n","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java#L157-L193","documentation":"ExecutionQueryImpl.processDefinitionKeys throws ActivitiIllegalArgumentException when the processDefinitionKeys Set is null. The query expects a concrete set of definition keys to filter against; an empty set is permitted, null is not. This supports querying executions across multiple process definitions at once.","triggerScenarios":"Calling query.processDefinitionKeys(keys) where keys is null, commonly an unset collection built from configuration or from another service call.","commonSituations":"Dynamic whitelist filtering where the key list is optional; a null returned from a properties lookup instead of an empty set; InMemory logging/reporting jobs that assemble key sets at runtime.","solutions":["Pass an initialized Set (empty set is fine if no keys are known)","Only call processDefinitionKeys when a non-null collection was collected","Coalesce null to Collections.emptySet() before invoking"],"exampleFix":"// before\nquery.processDefinitionKeys(allowedKeys);\n// after\nquery.processDefinitionKeys(allowedKeys == null ? Collections.emptySet() : allowedKeys);","handlingStrategy":"validation","validationCode":"query.processDefinitionKeys(keys == null ? Collections.emptySet() : keys);","typeGuard":"boolean hasKeys = keys != null;","tryCatchPattern":"try { q.processDefinitionKeys(keys); } catch (ActivitiIllegalArgumentException e) { q = q; /* proceed unfiltered */ }","preventionTips":["Initialize key sets to empty, never null","Use Collections.emptySet() as default for optional whitelist config","Sanitize collections from external sources before query building"],"tags":["java","activiti","query-builder","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-18T11:17:12.947Z"}