{"record":{"id":"4868639df75d96a0","repo":"flowable/flowable-engine","slug":"definitiontenantid-must-not-be-null","errorCode":null,"errorMessage":"definitionTenantId must not be null","messagePattern":"definitionTenantId must not be null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/tenant/ChangeTenantIdBuilderImpl.java","lineNumber":48,"sourceCode":"    public ChangeTenantIdBuilderImpl(String sourceTenantId, String targetTenantId, ChangeTenantIdManager changeTenantIdManager) {\n        if (sourceTenantId == null) {\n            throw new FlowableIllegalArgumentException(\"The source tenant id must not be null.\");\n        }\n        if (targetTenantId == null) {\n            throw new FlowableIllegalArgumentException(\"The target tenant id must not be null.\");\n        }\n        this.sourceTenantId = sourceTenantId;\n        this.targetTenantId = targetTenantId;\n        if (sourceTenantId.equals(targetTenantId)) {\n            throw new FlowableIllegalArgumentException(\"The source and the target tenant ids must be different.\");\n        }\n        this.changeTenantIdManager = changeTenantIdManager;\n    }\n\n    @Override\n    public ChangeTenantIdBuilder definitionTenantId(String definitionTenantId) {\n        if (definitionTenantId == null) {\n            throw new FlowableIllegalArgumentException(\"definitionTenantId must not be null\");\n        }\n        this.definitionTenantId = definitionTenantId;\n        return this;\n    }\n\n    @Override\n    public ChangeTenantIdResult simulate() {\n        return changeTenantIdManager.simulate(this);\n    }\n\n    @Override\n    public ChangeTenantIdResult complete() {\n        return changeTenantIdManager.complete(this);\n    }\n\n    public String getSourceTenantId() {\n        return sourceTenantId;\n    }","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/tenant/ChangeTenantIdBuilderImpl.java#L30-L66","documentation":"The fluent method ChangeTenantIdBuilder.definitionTenantId(String) throws FlowableIllegalArgumentException when called with null. It restricts the tenant change to definitions with a specific tenant id, and null is not an accepted value for that filter.","triggerScenarios":"Chaining changeTenantId(...).definitionTenantId(null) where the definition tenant id variable is null or uninitialized.","commonSituations":"An optional filter value that the caller passes through without null-checking; refactoring removed a default value previously used.","solutions":["Only call definitionTenantId when you actually have a non-null definition tenant id","Default or guard the value before chaining","Omit the filter entirely if all definitions should be included"],"exampleFix":"// before\nbuilder.definitionTenantId(definitionTenantId);\n// after\nif (definitionTenantId != null) {\n    builder.definitionTenantId(definitionTenantId);\n}","handlingStrategy":"validation","validationCode":"if (definitionTenantId != null) {\n    builder.definitionTenantId(definitionTenantId);\n}","typeGuard":null,"tryCatchPattern":"try {\n    builder.definitionTenantId(definitionTenantId);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"Skipping definitionTenantId filter: {}\", e.getMessage());\n}","preventionTips":["Only chain definitionTenantId when the filter value is present","Apply the fluent filter conditionally","Document that the filter does not accept null"],"tags":["flowable","null-check","fluent-api","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-18T11:17:12.947Z"}