maccamlc commented on a change in pull request #885:
URL: https://github.com/apache/avro/pull/885#discussion_r711480943



##########
File path: lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
##########
@@ -51,9 +65,27 @@ default String getTypeName() {
   public static void register(String logicalTypeName, LogicalTypeFactory 
factory) {
     Objects.requireNonNull(logicalTypeName, "Logical type name cannot be 
null");
     Objects.requireNonNull(factory, "Logical type factory cannot be null");
+
+    try {
+      String factoryTypeName = factory.getTypeName();
+      if (!logicalTypeName.equals(factoryTypeName)) {
+        throw new IllegalArgumentException(String.format(

Review comment:
       Changed to a log message. Might be useful if this can be cleaned up at 
some point, as seems could be confusing that TypeName can be defined in the 
Factory, but if a different name is used to Register, that will be used instead.




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