{"record":{"id":"b567c6941ddcef4d","repo":"Tencent/tinker","slug":"loadreporter-is-already-set","errorCode":null,"errorMessage":"loadReporter is already set.","messagePattern":"loadReporter is already set\\.","errorType":"exception","errorClass":"TinkerRuntimeException","httpStatus":null,"severity":"error","filePath":"tinker-android/tinker-android-lib-no-op/src/main/java/com/tencent/tinker/lib/tinker/Tinker.java","lineNumber":338,"sourceCode":"        }\n\n        public Builder tinkerLoadVerifyFlag(Boolean verifyMd5WhenLoad) {\n            if (verifyMd5WhenLoad == null) {\n                throw new TinkerRuntimeException(\"tinkerLoadVerifyFlag must not be null.\");\n            }\n            if (this.tinkerLoadVerifyFlag != null) {\n                throw new TinkerRuntimeException(\"tinkerLoadVerifyFlag is already set.\");\n            }\n            this.tinkerLoadVerifyFlag = verifyMd5WhenLoad;\n            return this;\n        }\n\n        public Builder loadReport(LoadReporter loadReporter) {\n            if (loadReporter == null) {\n                throw new TinkerRuntimeException(\"loadReporter must not be null.\");\n            }\n            if (this.loadReporter != null) {\n                throw new TinkerRuntimeException(\"loadReporter is already set.\");\n            }\n            this.loadReporter = loadReporter;\n            return this;\n        }\n\n        public Builder patchReporter(PatchReporter patchReporter) {\n            if (patchReporter == null) {\n                throw new TinkerRuntimeException(\"patchReporter must not be null.\");\n            }\n            if (this.patchReporter != null) {\n                throw new TinkerRuntimeException(\"patchReporter is already set.\");\n            }\n            this.patchReporter = patchReporter;\n            return this;\n        }\n\n        public Builder listener(PatchListener listener) {\n            if (listener == null) {","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-android/tinker-android-lib-no-op/src/main/java/com/tencent/tinker/lib/tinker/Tinker.java#L320-L356","documentation":"Tinker.Builder.loadReport(LoadReporter) throws TinkerRuntimeException(\"loadReporter is already set.\") on the second invocation — the reporter is a set-once builder property. This mirrors the other guards: load reporting must have exactly one owner, and re-assigning it (e.g. base config plus app config) would silently drop one set of callbacks.","triggerScenarios":"Calling loadReport(...) twice on the same Builder instance — shared init helper applying a default reporter plus the app applying its custom one, or a duplicated chain line left behind after refactoring initialization code.","commonSituations":"A common module configures DefaultLoadReporter and the host app wants a custom LoadReporter; merging Tinker init from two teams/SDKs; builder stored in a static field and configured in stages.","solutions":["Register exactly one LoadReporter — the app's custom one if it exists, otherwise DefaultLoadReporter — in a single loadReport() call.","If a base implementation plus extra behavior is needed, wrap both in one composite LoadReporter and register the composite.","Keep the entire builder chain in one method to make duplicate calls visually obvious."],"exampleFix":"// before\nbuilder.loadReport(new DefaultLoadReporter(app)); // base init\nbuilder.loadReport(new MyAppLoadReporter(app));   // throws: already set\n\n// after\nLoadReporter reporter = useCustom ? new MyAppLoadReporter(app) : new DefaultLoadReporter(app);\nbuilder.loadReport(reporter);","handlingStrategy":"validation","validationCode":"LoadReporter reporter = useCustom ? new MyAppLoadReporter(app) : new DefaultLoadReporter(app);\nbuilder.loadReport(reporter); // exactly one call","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One reporter per builder; wrap multiple behaviors in a composite reporter","Centralize the builder chain in a single init method"],"tags":["android","tinker","builder","configuration","reporter"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}