{"record":{"id":"c14ed0fe848f5e47","repo":"flowable/flowable-engine","slug":"categorynotequals-is-null","errorCode":null,"errorMessage":"categoryNotEquals is null","messagePattern":"categoryNotEquals 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":104,"sourceCode":"            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\");\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\");","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java#L86-L122","documentation":"AppDefinitionQueryImpl.appDefinitionCategoryNotEquals rejects a null argument with FlowableIllegalArgumentException. A null exclusion criterion is indistinguishable from a caller mistake, so the library fails fast instead of silently building a wrong or broken query.","triggerScenarios":"Calling appDefinitionCategoryNotEquals(null), e.g. when the excluded category is read from config/request input that is absent, or a caller builds the exclusion unconditionally from a nullable variable.","commonSituations":"Optional REST filter for 'exclude category X' left unset; configuration key missing so the variable is null; null returned from a lookup used directly as the filter value.","solutions":["Null-check the value and call appDefinitionCategoryNotEquals only when non-null","Use a sentinel non-null value if 'exclude nothing' must be expressed","Capture FlowableIllegalArgumentException and map it to a client-error response"],"exampleFix":"// before\nquery.appDefinitionCategoryNotEquals(excludedCategory);\n// after\nif (excludedCategory != null) {\n    query.appDefinitionCategoryNotEquals(excludedCategory);\n}","handlingStrategy":"validation","validationCode":"if (categoryNotEquals != null) {\n    query.appDefinitionCategoryNotEquals(categoryNotEquals);\n}","typeGuard":"boolean isApplicable(String v) { return v != null && !v.isEmpty(); }","tryCatchPattern":"try {\n    query.appDefinitionCategoryNotEquals(categoryNotEquals);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage(), e);\n}","preventionTips":["Wrap optional exclusion criteria in null checks before applying them","Use Optional<String> for optional filter inputs and apply conditionally","Document which query methods reject null so callers know to guard"],"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"}