RyanSkraba commented on a change in pull request #1301:
URL: https://github.com/apache/avro/pull/1301#discussion_r701997015



##########
File path: lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
##########
@@ -892,6 +902,9 @@ public int resolveUnion(Schema union, Object datum) {
   protected String getSchemaName(Object datum) {
     if (datum == null || datum == JsonProperties.NULL_VALUE)
       return Type.NULL.getName();
+    String primativeType = PRIMATIVE_DATUM_TYPES.get(datum.getClass());
+    if (primativeType != null)
+      return primativeType;

Review comment:
       I couldn't find any implementations that override these methods.   They 
should be safe to remove, but it looks like the intention was that subclasses 
of GenericData would be able to change their behaviour by overriding these 
methods. 
   
   That expectation (which nobody uses) would be broken by the primitive cache 
anyway... 
   
   @belugabehr what do you think?  Should these methods be cleaned up?




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