{"record":{"id":"d641457eeed3c7c9","repo":"flowable/flowable-engine","slug":"deploymentcategory-is-null-d64145","errorCode":null,"errorMessage":"deploymentCategory is null","messagePattern":"deploymentCategory is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CmmnDeploymentQueryImpl.java","lineNumber":99,"sourceCode":"            throw new FlowableIllegalArgumentException(\"deploymentName is null\");\n        }\n        this.name = deploymentName;\n        return this;\n    }\n\n    @Override\n    public CmmnDeploymentQueryImpl deploymentNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentNameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public CmmnDeploymentQueryImpl deploymentCategory(String deploymentCategory) {\n        if (deploymentCategory == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentCategory is null\");\n        }\n        this.category = deploymentCategory;\n        return this;\n    }\n\n    @Override\n    public CmmnDeploymentQueryImpl deploymentCategoryNotEquals(String deploymentCategoryNotEquals) {\n        if (deploymentCategoryNotEquals == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentCategoryExclude is null\");\n        }\n        this.categoryNotEquals = deploymentCategoryNotEquals;\n        return this;\n    }\n    \n    @Override\n    public CmmnDeploymentQueryImpl deploymentKey(String deploymentKey) {\n        if (deploymentKey == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentKey is null\");","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CmmnDeploymentQueryImpl.java#L81-L117","documentation":"Flowable throws this FlowableIllegalArgumentException when CmmnDeploymentQueryImpl.deploymentCategory(null) is called. Query criteria setters validate that the supplied filter value is non-null; a null category would produce an ambiguous SQL filter, so the library fails fast at query-build time instead of returning wrong results.","triggerScenarios":"Calling repositoryService.createCmmnDeploymentQuery().deploymentCategory(null), typically when the category value comes from an uninitialized variable, a missing configuration entry, or an unmarshalled request field.","commonSituations":"Building dynamic queries where the category filter is optional but the developer calls the setter unconditionally with a possibly-null variable; REST/API layers passing through null client parameters.","solutions":["Pass a non-null deployment category string to deploymentCategory()","If the category filter is optional, wrap the setter in an if (category != null) check","For the 'not set' case, simply omit the deploymentCategory() call instead of passing null"],"exampleFix":"// before\nquery.deploymentCategory(category); // category may be null\n// after\nif (category != null) {\n    query.deploymentCategory(category);\n}","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(category, \"deploymentCategory must not be null\");\nquery.deploymentCategory(category);","typeGuard":"boolean hasCategory = category != null && !category.isEmpty();","tryCatchPattern":"try {\n    query.deploymentCategory(category);\n} catch (FlowableIllegalArgumentException e) {\n    // fall back to unfiltered query or surface a 400 to the caller\n}","preventionTips":["Null-check optional filter values before calling query setters","Only invoke setter methods for filters you actually want to apply","Centralize query building in a helper that skips null filters"],"tags":["java","flowable","null-check","query"],"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"}