{"record":{"id":"2c264e143ea17709","repo":"flowable/flowable-engine","slug":"ids-are-null-2c264e","errorCode":null,"errorMessage":"ids are null","messagePattern":"ids are null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java","lineNumber":155,"sourceCode":"            throw new FlowableIllegalArgumentException(\"nameLikeIgnoreCase is null\");\n        }\n        this.nameLikeIgnoreCase = nameLikeIgnoreCase;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new FlowableIllegalArgumentException(\"ids are null\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl parentDeploymentId(String parentDeploymentId) {\n        if (parentDeploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"parentDeploymentId is null\");\n        }\n        this.parentDeploymentId = parentDeploymentId;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelDefinitionKey(String key) {\n        if (key == null) {\n            throw new FlowableIllegalArgumentException(\"key is null\");","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java#L137-L173","documentation":"ChannelDefinitionQueryImpl.deploymentIds() throws FlowableIllegalArgumentException when the passed Set<String> of deployment IDs is null. The Flowable query builders validate every filter argument eagerly so that invalid queries fail at construction time with a clear message rather than producing a broken SQL query or a confusing persistence-layer error later.","triggerScenarios":"Calling channelDefinitionQuery().deploymentIds(null) directly, or passing a Set<String> variable that was never initialized (e.g. a method parameter or a collected set that came back null from another API).","commonSituations":"Building the query from configuration/properties where deployment IDs were not configured; refactoring code that used deploymentId(String) into a set and forgetting initialization; passing a nullable variable returned by another service.","solutions":["Ensure a non-null Set is passed, e.g. deploymentIds(Collections.singleton(deploymentId))","If no deployment filter is wanted, do not call deploymentIds() at all instead of passing null","Guard the call site: only invoke deploymentIds(ids) when ids != null && !ids.isEmpty()","Initialize the Set with new HashSet<>() before use instead of leaving the variable null"],"exampleFix":"// before\nSet<String> ids = getConfiguredDeploymentIds(); // may return null\nquery.deploymentIds(ids);\n// after\nSet<String> ids = getConfiguredDeploymentIds();\nif (ids != null && !ids.isEmpty()) {\n    query.deploymentIds(ids);\n}","handlingStrategy":"validation","validationCode":"if (deploymentIds == null || deploymentIds.isEmpty()) {\n    throw new IllegalArgumentException(\"deploymentIds must be a non-empty set\");\n}\nquery.deploymentIds(deploymentIds);","typeGuard":"boolean hasDeploymentIds(Set<String> ids) {\n    return ids != null && !ids.isEmpty();\n}","tryCatchPattern":"try {\n    query.deploymentIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"Invalid deploymentIds filter: {}\", e.getMessage());\n    // proceed with an unfiltered query or rethrow as a client error\n}","preventionTips":["Never pass null to query filter methods; omit the filter call instead","Initialize Set fields eagerly (new HashSet<>()) so they are never null","Use Collections.singleton(id) when filtering on a single deployment","Validate query inputs at the API boundary before building Flowable queries"],"tags":["flowable","null-argument","query-builder","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-18T11:17:12.947Z"}