lragnarsson commented on a change in pull request #1320:
URL: https://github.com/apache/avro/pull/1320#discussion_r699084282



##########
File path: 
lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java
##########
@@ -191,26 +192,27 @@ public Schema getSchema(Class c) {
     return schema;
   }
 
-  private static final ThreadLocal<Map<Descriptor, Schema>> SEEN = 
ThreadLocal.withInitial(IdentityHashMap::new);
+  private static final ThreadLocal<Map<DescriptorProto, Schema>> SEEN = 
ThreadLocal.withInitial(IdentityHashMap::new);
 
   public Schema getSchema(Descriptor descriptor) {
-    Map<Descriptor, Schema> seen = SEEN.get();
-    if (seen.containsKey(descriptor)) // stop recursion
-      return seen.get(descriptor);
+    Map<DescriptorProto, Schema> seen = SEEN.get();
+    DescriptorProto dp = descriptor.toProto();
+    if (seen.containsKey(dp)) // stop recursion
+      return seen.get(dp);

Review comment:
       Makes sense, I didn't want to change too much of the current 
implementation though.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to