{"record":{"id":"4256b28ba07603a3","repo":"flowable/flowable-engine","slug":"appsdefinitionids-is-null","errorCode":null,"errorMessage":"appsDefinitionIds is null","messagePattern":"appsDefinitionIds 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":75,"sourceCode":"\n    public AppDefinitionQueryImpl(CommandContext commandContext) {\n        super(commandContext);\n    }\n\n    public AppDefinitionQueryImpl(CommandExecutor commandExecutor) {\n        super(commandExecutor);\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionId(String appDefinitionId) {\n        this.id = appDefinitionId;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQuery appDefinitionIds(Set<String> appsDefinitionIds) {\n        if (appsDefinitionIds == null) {\n            throw new FlowableIllegalArgumentException(\"appsDefinitionIds is null\");\n        } else if (appsDefinitionIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Empty appsDefinitionIds\");\n        }\n        this.ids = appsDefinitionIds;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionCategory(String category) {\n        if (category == null) {\n            throw new FlowableIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionCategoryLike(String categoryLike) {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java#L57-L93","documentation":"FlowableIllegalArgumentException thrown by AppDefinitionQueryImpl.appDefinitionIds when the Set of app definition ids passed is null. The query builder requires a non-null, non-empty set to filter on.","triggerScenarios":"Calling appDefinitionQuery.appDefinitionIds(null) while building an AppDefinitionQuery, typically when the id set comes from an upstream call or map lookup that returned null.","commonSituations":"Upstream list/map lookup produced null instead of an empty set; variable holding ids was never initialized; refactored code where a default set was removed.","solutions":["Pass a non-null Set of ids; if there is nothing to filter, skip the appDefinitionIds() call entirely","Null-check or default the set at the call site before building the query","Coalesce null to an empty collection and branch on it"],"exampleFix":"// before\nquery.appDefinitionIds(idsById.get(appKey)); // may be null\n// after\nSet<String> ids = idsById.getOrDefault(appKey, Collections.emptySet());\nif (!ids.isEmpty()) { query.appDefinitionIds(ids); }","handlingStrategy":"type-guard","validationCode":"if (ids != null && !ids.isEmpty()) {\n    query.appDefinitionIds(ids);\n}","typeGuard":"boolean isValidIdSet(Set<String> ids) { return ids != null && !ids.isEmpty(); }","tryCatchPattern":"try {\n    query.appDefinitionIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    // fall back to unfiltered query or propagate validation error\n}","preventionTips":["Initialize id sets with Collections.emptySet() instead of null","Null-check values from upstream lookups before query building","Add unit tests for query builders with null/empty inputs"],"tags":["flowable","query","null-argument","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"}