You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/29 00:37:22 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #10423: [schema] simplify code

codelipenghui commented on a change in pull request #10423:
URL: https://github.com/apache/pulsar/pull/10423#discussion_r622659669



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java
##########
@@ -102,12 +102,7 @@ public boolean supportSchemaVersioning() {
     }
 
     public static <T> AvroSchema<T> of(Class<T> pojo, Map<String, String> properties) {
-        ClassLoader pojoClassLoader = null;
-        if (pojo != null) {
-            pojoClassLoader = pojo.getClassLoader();
-        }
-        SchemaDefinition<T> schemaDefinition = SchemaDefinition.<T>builder().withPojo(pojo).withProperties(properties).build();
-        return new AvroSchema<>(parseSchemaInfo(schemaDefinition, SchemaType.AVRO), pojoClassLoader);
+        return AvroSchema.of(SchemaDefinition.<T>builder().withPojo(pojo).withProperties(properties).build());

Review comment:
       This change will change the behavior since we are using the pojo classloader before.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org