[
https://issues.apache.org/jira/browse/AVRO-3473?focusedWorklogId=794199&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-794199
]
ASF GitHub Bot logged work on AVRO-3473:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Jul/22 12:21
Start Date: 22/Jul/22 12:21
Worklog Time Spent: 10m
Work Description: opwvhk commented on code in PR #1624:
URL: https://github.com/apache/avro/pull/1624#discussion_r927597528
##########
lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java:
##########
@@ -184,11 +195,11 @@ public <T> Conversion<T> getConversionByClass(Class<T>
datumClass, LogicalType l
* @return the conversion for the logical type, or null
*/
@SuppressWarnings("unchecked")
- public Conversion<Object> getConversionFor(LogicalType logicalType) {
Review Comment:
Yes, they are:
1. The type erasure of a type variable is the erasure of its leftmost bound
(https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-4.6)
2. Because T has no bounds in the syntax, it's bound is `Object`
(https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-4.4)
So as far as binary compatibility is concerned, `<T> Conversion<T>` is the
same as `Conversion<Object>`.
Issue Time Tracking
-------------------
Worklog Id: (was: 794199)
Time Spent: 1h 10m (was: 1h)
> Automatically register Conversion<T> classes
> --------------------------------------------
>
> Key: AVRO-3473
> URL: https://issues.apache.org/jira/browse/AVRO-3473
> Project: Apache Avro
> Issue Type: Improvement
> Components: java, logical types
> Reporter: Oscar Westra van Holthe - Kind
> Assignee: Oscar Westra van Holthe - Kind
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.11.1
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Manually registering a {{Conversion<T>}} is cumbersome, but necessary if
> creating the factory requires constructor parameters.
> For most cases though, a {{Conversion<T>}} gets all the information it needs
> from the schema. This makes it a good candidate for a SPI (using the Java 6
> {{ServiceLoader}} class).
> This is the addendum to AVRO-3441, which does the same thing for
> {{{}LogicalTypeFactory{}}}.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)