{"record":{"id":"aaad5b2f42f0ca26","repo":"flowable/flowable-engine","slug":"deploymentkeylike-is-null","errorCode":null,"errorMessage":"deploymentKeyLike is null","messagePattern":"deploymentKeyLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/DeploymentQueryImpl.java","lineNumber":141,"sourceCode":"            throw new FlowableIllegalArgumentException(\"deploymentCategoryExclude is null\");\n        }\n        this.categoryNotEquals = deploymentCategoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentKey(String deploymentKey) {\n        if (deploymentKey == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentKey is null\");\n        }\n        this.key = deploymentKey;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentKeyLike(String deploymentKeyLike) {\n        if (deploymentKeyLike == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentKeyLike is null\");\n        }\n        this.keyLike = deploymentKeyLike;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentTenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentTenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentTenantIdLike is null\");","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/DeploymentQueryImpl.java#L123-L159","documentation":"Flowable's DeploymentQuery rejects a null argument to deploymentKeyLike() because a null 'like' pattern is indistinguishable from 'no filter was set'. The library throws FlowableIllegalArgumentException to force the caller to either pass a real pattern or omit the call entirely.","triggerScenarios":"Calling deploymentQuery.deploymentKeyLike(null), typically when the key-like value comes from a nullable variable, request parameter, or optional config.","commonSituations":"REST/service layers forwarding user-supplied filter params straight into the query builder; nullable fields in search DTOs; refactoring where a default value was removed.","solutions":["Pass a non-null like pattern, e.g. deploymentKeyLike(\"%my-key%\")","Only call deploymentKeyLike when the value is non-null; otherwise skip the filter","Validate/normalize the input before building the query"],"exampleFix":"// before\nquery.deploymentKeyLike(request.getKeyLike());\n// after\nif (request.getKeyLike() != null) {\n    query.deploymentKeyLike(request.getKeyLike());\n}","handlingStrategy":"validation","validationCode":"if (keyLike == null) { throw new IllegalArgumentException(\"deploymentKeyLike is required\"); }\nquery.deploymentKeyLike(keyLike);","typeGuard":"boolean hasDeploymentKeyLike(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.deploymentKeyLike(keyLike);\n} catch (FlowableIllegalArgumentException e) {\n    // fall back to unfiltered query or rethrow with context\n}","preventionTips":["Null-check optional filter inputs before applying them to queries","Use Optional<String> for filter params and only call setters when present","Centralize query building in one helper that guards nullable fields"],"tags":["query","null-argument","flowable"],"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"}