You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2021/09/18 04:45:23 UTC

[GitHub] [avro] maccamlc commented on a change in pull request #885: AVRO-2840 maven custom logical types

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: issues-unsubscribe@avro.apache.org

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