{"record":{"id":"c09a6208c30f22d0","repo":"flowable/flowable-engine","slug":"type-is-null-c09a62","errorCode":null,"errorMessage":"type is null","messagePattern":"type is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java","lineNumber":85,"sourceCode":"            throw new FlowableIllegalArgumentException(\"id is null\");\n        }\n        this.id = id;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery batchId(String batchId) {\n        if (batchId == null) {\n            throw new FlowableIllegalArgumentException(\"batchId is null\");\n        }\n        this.batchId = batchId;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery type(String type) {\n        if (type == null) {\n            throw new FlowableIllegalArgumentException(\"type is null\");\n        }\n        this.type = type;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery searchKey(String searchKey) {\n        if (searchKey == null) {\n            throw new FlowableIllegalArgumentException(\"searchKey is null\");\n        }\n        this.searchKey = searchKey;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery searchKey2(String searchKey2) {\n        if (searchKey2 == null) {\n            throw new FlowableIllegalArgumentException(\"searchKey2 is null\");","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java#L67-L103","documentation":"BatchPartQueryImpl.type(String) filters parts by their batch part type. A null argument throws FlowableIllegalArgumentException at the type(...) call since filtering by null type is not meaningful. The error fires before the query is executed.","triggerScenarios":"Calling BatchPartQuery.type(null), typically with a type value sourced from config, an enum-derived string, or a request parameter that was null.","commonSituations":"Configuration key for the batch part type missing; code deriving the type from an enum with no mapping; API clients omitting the type query parameter.","solutions":["Null-check the type before calling type(...).","If the filter is optional, build the query conditionally (only call type(t) when t != null).","Verify the config/constant supplying the type resolves to a non-null value."],"exampleFix":"// before\nBatchPartQuery q = batchService.createBatchPartQuery().type(partType);\n// after\nBatchPartQuery q = batchService.createBatchPartQuery();\nif (partType != null) {\n    q.type(partType);\n}","handlingStrategy":"validation","validationCode":"BatchPartQuery query = batchService.createBatchPartQuery();\nif (partType != null) {\n    query.type(partType);\n}\nList<BatchPart> parts = query.list();","typeGuard":"boolean hasType(String t) {\n    return t != null && !t.isEmpty();\n}","tryCatchPattern":"try {\n    List<BatchPart> parts = query.type(partType).list();\n} catch (org.flowable.common.engine.api.FlowableIllegalArgumentException e) {\n    log.warn(\"Null part type filter ignored; returning unfiltered results\", e);\n    parts = batchService.createBatchPartQuery().list();\n}","preventionTips":["Treat query filter parameters as required: null-check before passing.","Document which filters are optional and apply them conditionally."],"tags":["flowable","batch","query","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}