{"record":{"id":"e73d3f3a94cd01fa","repo":"flowable/flowable-engine","slug":"categorylike-is-null-e73d3f","errorCode":null,"errorMessage":"categoryLike is null","messagePattern":"categoryLike is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java","lineNumber":105,"sourceCode":"    @Override\n    public ProcessDefinitionQuery processDefinitionIds(Set<String> processDefinitionIds) {\n        this.ids = processDefinitionIds;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategory(String category) {\n        if (category == null) {\n            throw new ActivitiIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            throw new ActivitiIllegalArgumentException(\"categoryLike is null\");\n        }\n        this.categoryLike = categoryLike;\n        return this;\n    }\n\n    @Override\n    public ProcessDefinitionQueryImpl processDefinitionCategoryNotEquals(String categoryNotEquals) {\n        if (categoryNotEquals == null) {\n            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\");","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java#L87-L123","documentation":"ProcessDefinitionQueryImpl.processDefinitionCategoryLike(String) filters process definitions by category using a LIKE pattern. Flowable throws ActivitiIllegalArgumentException when the pattern is null, because the SQL LIKE clause requires a non-null string.","triggerScenarios":"Calling processDefinitionQuery.processDefinitionCategoryLike(null), typically from an uninitialized or optional user-supplied pattern.","commonSituations":"Search UIs with an optional category-pattern field passed unconditionally; code refactors that removed a default pattern value.","solutions":["Pass a non-null pattern, e.g. \"http://acme%\".","Null-check the pattern; omit processDefinitionCategoryLike() when not provided.","Default the pattern to \"%\" to match all categories.","Catch ActivitiIllegalArgumentException to handle bad query input centrally."],"exampleFix":"// before\nquery.processDefinitionCategoryLike(categoryPattern); // may be null\n// after\nif (categoryPattern != null) {\n    query.processDefinitionCategoryLike(categoryPattern);\n}","handlingStrategy":"validation","validationCode":"if (categoryLike != null && !categoryLike.isEmpty()) {\n    query.processDefinitionCategoryLike(categoryLike);\n}","typeGuard":"boolean hasCategoryPattern(String p) { return p != null && !p.isEmpty(); }","tryCatchPattern":"try {\n    query.processDefinitionCategoryLike(categoryLike);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    log.warn(\"Invalid categoryLike filter: {}\", e.getMessage());\n}","preventionTips":["Sanitize user-supplied LIKE patterns before applying them.","Conditionally apply optional pattern filters.","Keep a single query-builder helper that centralizes null-filter handling."],"tags":["activiti","flowable","process-definition","null-argument"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}