kennknowles commented on a change in pull request #16271:
URL: https://github.com/apache/beam/pull/16271#discussion_r785076419



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/AvroRecordSchema.java
##########
@@ -32,12 +32,14 @@
  * objects, creating a schema that matches that inferred by the AVRO libraries.
  */
 @SuppressWarnings({
+  "nullness", // TODO(https://issues.apache.org/jira/browse/BEAM-10402)
   "rawtypes" // TODO(https://issues.apache.org/jira/browse/BEAM-10556)
 })
 public class AvroRecordSchema extends GetterBasedSchemaProvider {
   @Override
   public <T> Schema schemaFor(TypeDescriptor<T> typeDescriptor) {
-    return 
toBeamSchema(ReflectData.get().getSchema(typeDescriptor.getRawType()));
+    Class<?> avroType = typeDescriptor.getRawType();

Review comment:
       ```suggestion
       Class<?> avroType = typeDescriptor.getRawType();
       @SuppressWarnings("nullness") // new ReflectData(ClassLoader) is not 
annotated to accept null
       ClassLoader classLoader = avroType.getClassLoader
       return toBeamSchema(new ReflectData(classLoader).getSchema(avroType));
   ```




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