{"record":{"id":"4039d684fb52a672","repo":"flowable/flowable-engine","slug":"namelike-is-null-4039d6","errorCode":null,"errorMessage":"nameLike is null","messagePattern":"nameLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":139,"sourceCode":"            throw new FlowableIllegalArgumentException(\"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 FlowableIllegalArgumentException(\"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 FlowableIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionNameLikeIgnoreCase(String nameLikeIgnoreCase) {\n        if (nameLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"nameLikeIgnoreCase is null\");\n        }\n        this.nameLikeIgnoreCase = nameLikeIgnoreCase;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"id is null\");","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessDefinitionQueryImpl.java#L121-L157","documentation":"Flowable throws FlowableIllegalArgumentException when processDefinitionNameLike(null) is called on a ProcessDefinitionQuery. The query API validates its builder arguments eagerly so that bad filters fail at query-construction time instead of producing confusing empty results or SQL issues later. A null 'like' pattern is meaningless as a name filter.","triggerScenarios":"Calling new ProcessDefinitionQueryImpl().processDefinitionNameLike(null) or the public API repositoryService.createProcessDefinitionQuery().processDefinitionNameLike(nameLike) with nameLike == null (e.g. when a user-supplied filter string was never initialized).","commonSituations":"Building dynamic queries from optional UI filters where the name filter variable stays null; deserializing query criteria from JSON where the field is absent; refactoring code that used processDefinitionName (which may also reject null) into the like variant.","solutions":["Pass a non-null like pattern, e.g. processDefinitionNameLike(\"%order%\").","Only add the nameLike filter when the value is non-null: if (nameLike != null) query.processDefinitionNameLike(nameLike);","Wrap the call in try-catch for FlowableIllegalArgumentException if the value comes from untrusted input, and surface a clear validation message."],"exampleFix":"// before\nString nameFilter = request.getName(); // may be null\nProcessDefinitionQuery q = repoService.createProcessDefinitionQuery()\n    .processDefinitionNameLike(nameFilter);\n// after\nString nameFilter = request.getName();\nProcessDefinitionQuery q = repoService.createProcessDefinitionQuery();\nif (nameFilter != null) {\n    q = q.processDefinitionNameLike(nameFilter);\n}","handlingStrategy":"validation","validationCode":"if (nameLike == null || nameLike.isEmpty()) { throw new IllegalArgumentException(\"nameLike must be a non-empty string\"); }\nquery.processDefinitionNameLike(nameLike);","typeGuard":"boolean isValidPattern(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.processDefinitionNameLike(nameLike);\n} catch (org.flowable.common.engine.api.FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"Invalid nameLike filter: \" + e.getMessage());\n}","preventionTips":["Treat all query filter strings as Optional and only apply non-null values","Validate user input at the API boundary before building Flowable queries","Never pass optional UI filter fields straight into the builder chain"],"tags":["flowable","null-argument","query-builder","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"}