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 01:06:55 UTC

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

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



##########
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:
       The next call will perform the same behavior[Please take a look here](https://github.com/apache/pulsar/blob/5712695817c3ccace6047e65674061bb104a334f/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java#L94)
   




-- 
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