{"record":{"id":"9f63800510132d0d","repo":"flowable/flowable-engine","slug":"resourcenamelike-is-null-9f6380","errorCode":null,"errorMessage":"resourceNameLike is null","messagePattern":"resourceNameLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java","lineNumber":206,"sourceCode":"            throw new FlowableIllegalArgumentException(\"keyLike is null\");\n        }\n        this.keyLike = keyLike;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionResourceName(String resourceName) {\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n        this.resourceName = resourceName;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionResourceNameLike(String resourceNameLike) {\n        if (resourceNameLike == null) {\n            throw new FlowableIllegalArgumentException(\"resourceNameLike is null\");\n        }\n        this.resourceNameLike = resourceNameLike;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionVersion(Integer version) {\n        checkVersion(version);\n        this.version = version;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQuery caseDefinitionVersionGreaterThan(Integer caseDefinitionVersion) {\n        checkVersion(caseDefinitionVersion);\n        this.versionGt = caseDefinitionVersion;\n        return this;\n    }","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java#L188-L224","documentation":"Flowable's CaseDefinitionQueryImpl throws FlowableIllegalArgumentException when caseDefinitionResourceNameLike(null) is called. The query builder validates each filter argument eagerly so that malformed queries fail at construction time rather than producing broken SQL or silent empty results at execution. Passing null here is never meaningful because a null 'like' filter is simply omitted.","triggerScenarios":"Calling caseDefinitionResourceNameLike(null) on a CaseDefinitionQuery (or CaseDefinitionQueryImpl), typically when the filter value comes from a variable, request parameter, or map lookup that is missing.","commonSituations":"Building dynamic queries from optional REST query parameters where the caller does not check for null before forwarding the value; configuration maps with missing keys; refactors that change the default of a local variable to null instead of skipping the filter call.","solutions":["Check the resourceNameLike value for null and only call caseDefinitionResourceNameLike when it is non-null.","If an empty/absent filter should match everything, skip the method call entirely (do not pass null or empty string).","If null indicates a bug, fix the upstream producer of the value (missing config key, unbound request parameter)."],"exampleFix":"// before\nquery.caseDefinitionResourceNameLike(request.getResourceNameLike());\n\n// after\nif (request.getResourceNameLike() != null) {\n    query.caseDefinitionResourceNameLike(request.getResourceNameLike());\n}","handlingStrategy":"validation","validationCode":"if (resourceNameLike != null) {\n    query.caseDefinitionResourceNameLike(resourceNameLike);\n}","typeGuard":"boolean hasFilter(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.caseDefinitionResourceNameLike(value);\n} catch (FlowableIllegalArgumentException e) {\n    if (!e.getMessage().contains(\"resourceNameLike\")) throw e;\n    // fall back to unfiltered query\n    query = repositoryService.createCaseDefinitionQuery();\n}","preventionTips":["Null-check every filter value from dynamic sources before applying it","Treat null as 'no filter' and skip the builder call","Centralize query building in one helper that filters out null values"],"tags":["null-argument","query-builder","cmmn","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"}