{"record":{"id":"9c38f82f9134138e","repo":"apache/pulsar","slug":"not-implemented-for-this-getclass","errorCode":null,"errorMessage":"Not implemented for ${this.getClass}","messagePattern":"Not implemented for (.+?)","errorType":"exception","errorClass":"SchemaSerializationException","httpStatus":null,"severity":"error","filePath":"pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AbstractSchema.java","lineNumber":84,"sourceCode":"\n    @Override\n    public Schema<T> clone() {\n        return this;\n    }\n\n    /**\n     * Return an instance of this schema at the given version.\n     * @param schemaVersion the version\n     * @return the schema at that specific version\n     * @throws SchemaSerializationException in case of unknown schema version\n     * @throws NullPointerException in case of null schemaVersion and supportSchemaVersioning is true\n     */\n    public Schema<?> atSchemaVersion(byte[] schemaVersion) throws SchemaSerializationException {\n        if (!supportSchemaVersioning()) {\n            return this;\n        }\n        Objects.requireNonNull(schemaVersion);\n        throw new SchemaSerializationException(\"Not implemented for \" + this.getClass());\n    }\n}\n","sourceCodeStart":66,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AbstractSchema.java#L66-L87","documentation":"AbstractSchema.atSchemaVersion(byte[]) adapts a schema to a specific schema version. If the schema does not support schema versioning the current instance is returned; otherwise the default implementation throws this SchemaSerializationException, meaning the schema claims versioning support but has not implemented per-version schema resolution.","triggerScenarios":"Calling atSchemaVersion(schemaVersion) with a non-null version on an AbstractSchema subclass whose supportSchemaVersioning() returns true but which does not override atSchemaVersion — typical with custom schemas that advertise versioning support.","commonSituations":"Custom schema implementations overriding supportSchemaVersioning() but not atSchemaVersion(); broker-side message re-encoding paths requesting schema-version-aware decoding against a generic/custom schema.","solutions":["Override atSchemaVersion(byte[]) in your schema to resolve the correct Schema<?> for the version.","If your schema truly has no per-version behavior, make supportSchemaVersioning() return false so `this` is returned instead of throwing.","Avoid calling atSchemaVersion on schemas that don't support versioning; check supportSchemaVersioning() first."],"exampleFix":"// before\npublic boolean supportSchemaVersioning() { return true; } // but no atSchemaVersion override\n// after\npublic boolean supportSchemaVersioning() { return false; }\n// or implement:\npublic Schema<?> atSchemaVersion(byte[] v) {\n  SchemaInfo info = schemaInfoProvider.getSchemaByVersion(v).join();\n  return Schema.getSchemaInfoBasedSchema(info);\n}","handlingStrategy":"type-guard","validationCode":"if (schema.supportSchemaVersioning()) { /* ensure the schema also overrides atSchemaVersion before calling it */ }","typeGuard":"boolean supportsAtSchemaVersion(Schema<?> s) { try { s.getClass().getDeclaredMethod(\"atSchemaVersion\", byte[].class); return true; } catch (NoSuchMethodException e) { return false; } }","tryCatchPattern":"try { Schema<?> v = schema.atSchemaVersion(version); } catch (SchemaSerializationException e) { /* fall back to the base schema */ }","preventionTips":["If a custom schema overrides supportSchemaVersioning() it must also override atSchemaVersion().","Return false from supportSchemaVersioning() when per-version resolution is not implemented.","Pair overriding with tests covering atSchemaVersion with real registry versions."],"tags":["schema","schema-versioning","not-implemented","serialization"],"backgroundTag":"method-not-implemented","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}