{"record":{"id":"a72a85b7e0d35958","repo":"flowable/flowable-engine","slug":"namelike-is-null-a72a85","errorCode":null,"errorMessage":"nameLike is null","messagePattern":"nameLike is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":132,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"categoryNotEquals is null\");\n        }\n        this.categoryNotEquals = categoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionName(String name) {\n        if (name == null) {\n            throw new ActivitiIllegalArgumentException(\"name is null\");\n        }\n        this.name = name;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new ActivitiIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new ActivitiIllegalArgumentException(\"id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new ActivitiIllegalArgumentException(\"ids are null\");","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java#L114-L150","documentation":"Flowable's ProcessDefinitionQueryImpl.processDefinitionNameLike(String) rejects a null nameLike parameter by throwing ActivitiIllegalArgumentException with message 'nameLike is null'. The query builder requires an actual LIKE pattern string; passing null would silently break the generated SQL filter, so the engine validates eagerly at API-call time rather than at query execution. This is a client-side argument contract violation, not a database or state problem.","triggerScenarios":"Calling ProcessDefinitionQuery.processDefinitionNameLike(null) directly, or indirectly when a caller-supplied filter variable that was expected to hold a name pattern is null (e.g. nameLike = request.getParameter(...) returning null, or an unset config field passed through).","commonSituations":"Web/API layers forwarding query-string filters into the query builder without checking for missing parameters; refactors where a default pattern constant was removed; mapping code copying optional DTO fields into the query unconditionally.","solutions":["Ensure a non-null LIKE pattern is passed, e.g. nameLike(\"%order%\")","If the filter is optional, only call processDefinitionNameLike when the value is non-null","Default the value to a wildcard pattern like \"%%\" if 'match all' is intended","Catch ActivitiIllegalArgumentException to surface a 400-style validation message to the caller"],"exampleFix":"// before\nquery.processDefinitionNameLike(request.getNameLike()); // NPE-ish if absent\n// after\nif (request.getNameLike() != null) {\n    query.processDefinitionNameLike(request.getNameLike());\n}","handlingStrategy":"validation","validationCode":"if (nameLike == null) throw new IllegalArgumentException(\"nameLike pattern is required\");\nquery.processDefinitionNameLike(nameLike);","typeGuard":"boolean isValidPattern(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.processDefinitionNameLike(nameLike);\n} catch (ActivitiIllegalArgumentException e) {\n    if (e.getMessage().contains(\"nameLike is null\")) {\n        throw new BadRequestException(\"nameLike filter must not be null\");\n    }\n    throw e;\n}","preventionTips":["Null-check optional filter inputs before applying them to the query builder","Never forward raw request parameters into query methods without validation","Use Optional<String> and ifPresent to apply filters conditionally","Document which query filters are mandatory vs optional"],"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"}