{"record":{"id":"4f502e4a4b2af975","repo":"flowable/flowable-engine","slug":"resourcenamelike-is-null-4f502e","errorCode":null,"errorMessage":"resourceNameLike is null","messagePattern":"resourceNameLike is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":186,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"keyLike is null\");\n        }\n        this.keyLike = keyLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionResourceName(String resourceName) {\n        if (resourceName == null) {\n            throw new ActivitiIllegalArgumentException(\"resourceName is null\");\n        }\n        this.resourceName = resourceName;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionResourceNameLike(String resourceNameLike) {\n        if (resourceNameLike == null) {\n            throw new ActivitiIllegalArgumentException(\"resourceNameLike is null\");\n        }\n        this.resourceNameLike = resourceNameLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionVersion(Integer version) {\n        checkVersion(version);\n        this.version = version;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQuery processDefinitionVersionGreaterThan(Integer processDefinitionVersion) {\n        checkVersion(processDefinitionVersion);\n        this.versionGt = processDefinitionVersion;\n        return this;\n    }","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java#L168-L204","documentation":"ProcessDefinitionQueryImpl.processDefinitionResourceNameLike(String) throws ActivitiIllegalArgumentException 'resourceNameLike is null' when the LIKE pattern for the resource name is null. The engine validates the argument at query-construction time so the SQL LIKE predicate is always formed from a real string. Passing null breaches the API contract.","triggerScenarios":"Calling ProcessDefinitionQuery.processDefinitionResourceNameLike(null), e.g. when the pattern is taken from an absent request parameter or an unset property.","commonSituations":"Filter UIs passing raw (often null) search inputs; environment-specific config for resource folder patterns that is missing; code that previously built the pattern with String.format on a null argument and now forwards null directly.","solutions":["Provide a non-null LIKE pattern, e.g. \"%order%.bpmn20.xml\"","Guard the call and skip the filter when the pattern is null","Default the pattern to \"%\" if 'any resource' is the intended behavior","Catch ActivitiIllegalArgumentException to produce a client-facing validation message"],"exampleFix":"// before\nquery.processDefinitionResourceNameLike(pattern);\n// after\nif (pattern != null) {\n    query.processDefinitionResourceNameLike(pattern);\n}","handlingStrategy":"validation","validationCode":"if (resourceNameLike == null) throw new IllegalArgumentException(\"resourceNameLike pattern is required\");\nquery.processDefinitionResourceNameLike(resourceNameLike);","typeGuard":"boolean isValidPattern(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.processDefinitionResourceNameLike(pattern);\n} catch (ActivitiIllegalArgumentException e) {\n    if (e.getMessage().contains(\"resourceNameLike is null\")) {\n        throw new BadRequestException(\"resourceNameLike pattern must not be null\");\n    }\n    throw e;\n}","preventionTips":["Null-check search inputs before applying LIKE filters","Default missing patterns to \"%\" only when match-all is acceptable","Validate pattern contents (escape wildcards) before passing to the engine","Apply optional filters conditionally instead of unconditionally"],"tags":["java","null-argument","query-builder","activiti","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-14T05:17:10.506Z"}