{"record":{"id":"962bed9f8e2d9c5b","repo":"flowable/flowable-engine","slug":"categorynotequals-is-null-962bed","errorCode":null,"errorMessage":"categoryNotEquals is null","messagePattern":"categoryNotEquals is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java","lineNumber":85,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"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 ActivitiIllegalArgumentException(\"nameLike is null\");","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java#L67-L103","documentation":"ModelQueryImpl.modelCategoryNotEquals(String) excludes models whose category equals the given value; null is rejected because 'not equals null' is not a meaningful query predicate. Null input throws ActivitiIllegalArgumentException.","triggerScenarios":"repositoryService.createModelQuery().modelCategoryNotEquals(excludedCategory) where excludedCategory is null, e.g. from an unset filter option.","commonSituations":"UI 'exclude category' option left empty and bound to null; configuration-driven exclusion list containing a null entry; refactoring replaced an empty-string sentinel with null.","solutions":["Only call modelCategoryNotEquals when the value is non-null/non-empty","Drop the exclusion filter when no category should be excluded","Filter nulls out of any configured exclusion list before applying it"],"exampleFix":"// before\nquery.modelCategoryNotEquals(config.getExcludeCategory());\n// after\nif (config.getExcludeCategory() != null) {\n    query.modelCategoryNotEquals(config.getExcludeCategory());\n}","handlingStrategy":"validation","validationCode":"if (categoryNotEquals != null && !categoryNotEquals.isEmpty()) { query.modelCategoryNotEquals(categoryNotEquals); }","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.modelCategoryNotEquals(excluded);\n} catch (ActivitiIllegalArgumentException e) {\n    // proceed without exclusion filter\n}","preventionTips":["Filter null entries out of configured exclusion values before use","Keep an explicit empty-string sentinel if 'exclude nothing' must be distinguished","Apply exclusion filters conditionally"],"tags":["java","flowable","model-query","null-check","query-filter"],"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"}