{"record":{"id":"2ab418d78a65007e","repo":"flowable/flowable-engine","slug":"categorylike-is-null","errorCode":null,"errorMessage":"categoryLike is null","messagePattern":"categoryLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java","lineNumber":95,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Empty appsDefinitionIds\");\n        }\n        this.ids = appsDefinitionIds;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionCategory(String category) {\n        if (category == null) {\n            throw new FlowableIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionCategoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            throw new FlowableIllegalArgumentException(\"categoryLike is null\");\n        }\n        this.categoryLike = categoryLike;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionCategoryNotEquals(String categoryNotEquals) {\n        if (categoryNotEquals == null) {\n            throw new FlowableIllegalArgumentException(\"categoryNotEquals is null\");\n        }\n        this.categoryNotEquals = categoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"name is null\");","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java#L77-L113","documentation":"Flowable's AppDefinitionQueryImpl validates every query criterion before storing it. Calling appDefinitionCategoryLike(null) throws FlowableIllegalArgumentException because a null 'like' pattern cannot be translated into a SQL LIKE clause. The check happens eagerly at query-building time, not at query execution.","triggerScenarios":"Calling appDefinitionQuery.appDefinitionCategoryLike(categoryLike) with a null String, typically when the value comes from an unset/unbound variable, a missing request parameter, or a caller that builds criteria conditionally but passes the variable unconditionally.","commonSituations":"REST/API layers binding optional query params (categoryLike not supplied -> null); code refactored so a previously-defaulted value became nullable; dynamic query builders that always call every filter method.","solutions":["Check the value for null before calling appDefinitionCategoryLike, and only call it when non-null","Default the value to a non-null pattern (e.g. \"%\") if a match-all is intended","If a null means 'no filter', restructure to conditionally apply the criterion","Catch FlowableIllegalArgumentException at the API boundary and return a 400 with the message"],"exampleFix":"// before\nquery.appDefinitionCategoryLike(categoryLike);\n// after\nif (categoryLike != null) {\n    query.appDefinitionCategoryLike(categoryLike);\n}","handlingStrategy":"validation","validationCode":"if (categoryLike != null) {\n    query.appDefinitionCategoryLike(categoryLike);\n}","typeGuard":"boolean isApplicable(String v) { return v != null && !v.isEmpty(); }","tryCatchPattern":"try {\n    query.appDefinitionCategoryLike(categoryLike);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage(), e);\n}","preventionTips":["Only call query-criteria methods when the filter value is non-null","Normalize optional request parameters to Optional<String> and filter with ifPresent","Never forward nullable DTO fields straight into Flowable query builders"],"tags":["flowable","null-check","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"}