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 2022/03/09 11:20:49 UTC

[GitHub] [avro] opwvhk commented on a change in pull request #1590: AVRO-3441: ServiceLoader for LogicalTypeFactory

opwvhk commented on a change in pull request #1590:
URL: https://github.com/apache/avro/pull/1590#discussion_r822545603



##########
File path: lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
##########
@@ -40,6 +57,12 @@ default String getTypeName() {
 
   private static final Map<String, LogicalTypeFactory> REGISTERED_TYPES = new ConcurrentHashMap<>();
 
+  static {
+    for (LogicalTypeFactory logicalTypeFactory : ServiceLoader.load(LogicalTypeFactory.class)) {
+      register(logicalTypeFactory);
+    }
+  }

Review comment:
       This is the actual magic.




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