{"record":{"id":"de3a71d86a8bec3c","repo":"apache/pulsar","slug":"failed-to-clone-readerconfigurationdata","errorCode":null,"errorMessage":"Failed to clone ReaderConfigurationData","messagePattern":"Failed to clone ReaderConfigurationData","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ReaderConfigurationData.java","lineNumber":199,"sourceCode":"        }\n        return topicNames.iterator().next();\n    }\n\n    @JsonIgnore\n    public void setTopicName(String topicNames) {\n        //Compatible with a single topic\n        this.topicNames.clear();\n        this.topicNames.add(topicNames);\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public ReaderConfigurationData<T> clone() {\n        try {\n            ReaderConfigurationData<T> clone = (ReaderConfigurationData<T>) super.clone();\n            clone.setTopicNames(new HashSet<>(clone.getTopicNames()));\n            return clone;\n        } catch (CloneNotSupportedException e) {\n            throw new RuntimeException(\"Failed to clone ReaderConfigurationData\");\n        }\n    }\n\n    @SuppressFBWarnings({\"EI_EXPOSE_REP\"})\n    public MessageCrypto<?, ?> getMessageCrypto() {\n        return messageCrypto;\n    }\n\n    @SuppressFBWarnings({\"EI_EXPOSE_REP2\"})\n    public void setMessageCrypto(MessageCrypto<?, ?> messageCrypto) {\n        this.messageCrypto = messageCrypto;\n    }\n}\n","sourceCodeStart":181,"sourceCodeEnd":213,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ReaderConfigurationData.java#L181-L213","documentation":"ReaderConfigurationData.clone() deep-copies the topicNames set to avoid shared mutable state and wraps CloneNotSupportedException in this RuntimeException. As with the other configuration clones, the exception is defensive and unreachable for correctly built classes since the class implements Cloneable.","triggerScenarios":"Called whenever PulsarClientImpl.createReaderAsync makes a defensive copy of reader configuration before use.","commonSituations":"Only expected under classpath corruption, shading, or instrumentation agents that alter the pulsar-client classes.","solutions":["Check for bytecode agents or shading that could affect Cloneable on pulsar-client classes.","Use a single consistent version of pulsar-client dependencies.","If reproducible on a clean classpath, report a bug to the Pulsar project."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { ReaderConfigurationData<T> copy = conf.clone(); } catch (RuntimeException e) { /* rebuild configuration manually */ }","preventionTips":["Use consistent pulsar-client artifacts; avoid shading/instrumentation of library classes.","Treat occurrences as environment/classpath problems."],"tags":["clone","reader","internal","configuration"],"backgroundTag":"clone-not-supported","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}