{"record":{"id":"a49eaafca25a1982","repo":"flowable/flowable-engine","slug":"categorynotequals-is-null-a49eaa","errorCode":null,"errorMessage":"categoryNotEquals is null","messagePattern":"categoryNotEquals is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ModelQueryImpl.java","lineNumber":87,"sourceCode":"            throw new FlowableIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public ModelQueryImpl modelCategoryLike(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 ModelQueryImpl modelCategoryNotEquals(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 ModelQueryImpl modelName(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 ModelQueryImpl modelNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"nameLike is null\");","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ModelQueryImpl.java#L69-L105","documentation":"ModelQueryImpl.modelCategoryNotEquals filters out models whose category equals the given value. A null argument throws FlowableIllegalArgumentException because 'not equals null' is not a meaningful filter in the underlying query; do not call the method when the exclusion value is absent.","triggerScenarios":"Calling repositoryService.createModelQuery().modelCategoryNotEquals(excludedCategory) with a null value, typically from an optional exclusion filter in UI or API input.","commonSituations":"Admin dashboards letting users exclude a category via a dropdown that defaults to null; batch jobs with optional exclusion config entries left blank.","solutions":["Only invoke modelCategoryNotEquals when the value is non-null (conditional query building)","Provide a concrete category string to exclude","Validate configuration/request input before building the query","If the intent is 'any category except none', use modelCategory(...) with a positive filter instead"],"exampleFix":"// before\nModelQuery q = repositoryService.createModelQuery()\n    .modelCategoryNotEquals(opts.getExcludedCategory()); // may be null\n// after\nModelQuery q = repositoryService.createModelQuery();\nif (opts.getExcludedCategory() != null) {\n    q = q.modelCategoryNotEquals(opts.getExcludedCategory());\n}","handlingStrategy":"validation","validationCode":"if (categoryNotEquals != null) { query = query.modelCategoryNotEquals(categoryNotEquals); }","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    List<Model> models = query.modelCategoryNotEquals(excluded).list();\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Bad exclusion filter: {}\", e.getMessage());\n}","preventionTips":["Apply exclusion filters only when a concrete value is provided","Document that null means 'no filter' so callers skip the method","Validate optional config entries feeding the exclusion"],"tags":["java","flowable","query","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-18T16:30:33.424Z"}