{"record":{"id":"74723c415d1d3c65","repo":"flowable/flowable-engine","slug":"deploymentnamelike-is-null-74723c","errorCode":null,"errorMessage":"deploymentNameLike is null","messagePattern":"deploymentNameLike 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":90,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Deployment ids is null\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public CmmnDeploymentQueryImpl deploymentName(String deploymentName) {\n        if (deploymentName == null) {\n            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\");","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CmmnDeploymentQueryImpl.java#L72-L108","documentation":"FlowableIllegalArgumentException thrown by CmmnDeploymentQueryImpl.deploymentNameLike when the nameLike argument is null. The LIKE-style name filter requires a non-null pattern string (optionally containing SQL wildcards like %); null is rejected as invalid.","triggerScenarios":"Calling createDeploymentQuery().deploymentNameLike(null), commonly when building a dynamic search where the user did not supply a name pattern and the null was passed straight through.","commonSituations":"Search forms with optional 'name contains' fields, API query params absent so mapped to null, dynamic query assembly from maps/config with missing keys.","solutions":["Omit the deploymentNameLike() call when no pattern is provided so the filter is skipped","Construct the pattern including wildcards (e.g. \"%\" + input + \"%\") only when input is non-null","Validate/sanitize the search input before building the query"],"exampleFix":"// before\nquery.deploymentNameLike(\"%\" + userInput + \"%\"); // NPE if userInput null\n// after\nif (userInput != null && !userInput.isEmpty()) { query.deploymentNameLike(\"%\" + userInput + \"%\"); }","handlingStrategy":"validation","validationCode":"if (pattern != null && !pattern.isEmpty()) { query.deploymentNameLike(\"%\" + pattern + \"%\"); }","typeGuard":"static boolean hasNamePattern(String p) { return p != null && !p.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.deploymentNameLike(pattern);\n} catch (FlowableIllegalArgumentException e) {\n    if (\"deploymentNameLike is null\".equals(e.getMessage())) {\n        throw new IllegalArgumentException(\"nameLike pattern must not be null; omit the filter instead\", e);\n    }\n    throw e;\n}","preventionTips":["Only add the deploymentNameLike filter when a search term is present","Escape user wildcards if literal matching is intended","Keep optional-filter logic in one query-builder helper","Test dynamic query assembly with absent search fields"],"tags":["null-check","query","argument-validation","cmmn"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:30:33.424Z"}