{"record":{"id":"cd6f03b5f9ffb778","repo":"flowable/flowable-engine","slug":"namelike-is-null","errorCode":null,"errorMessage":"nameLike is null","messagePattern":"nameLike 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":122,"sourceCode":"            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\");\n        }\n        this.name = name;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionNameLike(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 AppDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new FlowableIllegalArgumentException(\"ids are null\");","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java#L104-L140","documentation":"appDefinitionNameLike(null) throws FlowableIllegalArgumentException since a null cannot form a LIKE pattern against the app definition name column. Validation is performed immediately in the query builder.","triggerScenarios":"Calling appDefinitionNameLike(nameLike) with null, typically when the search term comes from an optional request parameter or a nullable field of a search-criteria object.","commonSituations":"Empty search box bound as null instead of skipped; API clients omitting the nameLike query parameter; code that concatenates wildcards onto a possibly-null base value.","solutions":["Null-check before calling; skip the criterion when absent","Normalize empty strings and null to 'no filter' in your input layer","Handle FlowableIllegalArgumentException and return a 400 to the caller"],"exampleFix":"// before\nquery.appDefinitionNameLike(\"%\" + nameLike + \"%\");\n// after\nif (nameLike != null && !nameLike.isEmpty()) {\n    query.appDefinitionNameLike(\"%\" + nameLike + \"%\");\n}","handlingStrategy":"validation","validationCode":"if (nameLike != null && !nameLike.isEmpty()) {\n    query.appDefinitionNameLike(nameLike);\n}","typeGuard":"boolean isApplicable(String v) { return v != null && !v.isEmpty(); }","tryCatchPattern":"try {\n    query.appDefinitionNameLike(nameLike);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage(), e);\n}","preventionTips":["Treat empty and null search input as 'no filter' and skip the call","Build wildcard patterns only after null-checking the base value","Centralize query building in one helper that guards all optional criteria"],"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"}