{"record":{"id":"06de984101955ea4","repo":"flowable/flowable-engine","slug":"provided-scope-ids-are-null-06de98","errorCode":null,"errorMessage":"Provided scope ids are null","messagePattern":"Provided scope ids are null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java","lineNumber":255,"sourceCode":"    }\n    \n    @Override\n    public SuspendedJobQueryImpl scopeId(String scopeId) {\n        if (scopeId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided scope id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.scopeId = scopeId;\n        } else {\n            this.scopeId = scopeId;\n        }\n        return this;\n    }\n\n    @Override\n    public SuspendedJobQueryImpl scopeIds(Collection<String> scopeIds) {\n        if (scopeIds == null) {\n            throw new FlowableIllegalArgumentException(\"Provided scope ids are null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.scopeIds = scopeIds;\n        } else {\n            this.scopeIds = scopeIds;\n        }\n        return this;\n    }\n    \n    @Override\n    public SuspendedJobQueryImpl withoutScopeId() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.withoutScopeId = true;\n        } else {\n            this.withoutScopeId = true;\n        }\n        return this;\n    }","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java#L237-L273","documentation":"This FlowableIllegalArgumentException is thrown by SuspendedJobQueryImpl.scopeIds() when the caller passes a null Collection of scope ids. Like all Flowable query filters, a null collection is rejected as invalid input; an empty collection is the correct way to express 'no ids' if that is supported by the caller's logic. The check fails fast so the query cannot be built in an inconsistent state.","triggerScenarios":"Calling suspendedJobQuery().scopeIds(null), usually when a list of ids was computed by a method that returned null, or a JSON/REST payload omitted the ids array and it was deserialized as null.","commonSituations":"Optional batch filters assembled dynamically; deserialization of missing JSON arrays into null; aggregating ids from multiple sources where one source is missing.","solutions":["Apply scopeIds() conditionally only when the collection is non-null","Default the collection to Collections.emptyList() where empty semantics are intended","Correct upstream deserialization to produce empty collections instead of null","Check the aggregation logic so it never returns a null list"],"exampleFix":"// before\nquery.scopeIds(scopeIds); // may be null\n// after\nif (scopeIds != null && !scopeIds.isEmpty()) {\n    query.scopeIds(scopeIds);\n}","handlingStrategy":"validation","validationCode":"if (scopeIds != null && !scopeIds.isEmpty()) {\n    query.scopeIds(scopeIds);\n}","typeGuard":"boolean hasScopeIds = scopeIds != null && !scopeIds.isEmpty();","tryCatchPattern":"try {\n    query.scopeIds(scopeIds);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"scope ids are null\")) {\n        // rebuild query without the scopeIds filter\n    } else {\n        throw e;\n    }\n}","preventionTips":["Ensure JSON deserialization yields empty collections, never null (init fields to new ArrayList<>())","Return empty collections from aggregation helpers","Check both null and emptiness before applying IN-style filters","Add tests for 'no ids provided' query paths"],"tags":["java","flowable","query","null-check","collection"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}