ashley-taylor commented on code in PR #3436:
URL: https://github.com/apache/avro/pull/3436#discussion_r2508588939
##########
lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java:
##########
@@ -811,10 +830,29 @@ private void setElement(Schema schema, Type element) {
schema.addProp(ELEMENT_PROP, c.getName());
}
+ private Class[] getUnion(AnnotatedElement element) {
+ Union union = element.getAnnotation(Union.class);
+ if (union != null) {
+ return union.value();
+ }
+
+ if (element instanceof Class) {
+ // automatic sealed class polymorphic
+ try {
+ if (IS_SEALED_METHOD != null &&
Boolean.TRUE.equals(IS_SEALED_METHOD.invoke(element))) {
+ return (Class<?>[]) GET_PERMITTED_SUBCLASSES_METHOD.invoke(element);
Review Comment:
@martin-g thanks for the review. Have made it skip the abstract and
recursive.
--
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]