kennknowles commented on code in PR #26413:
URL: https://github.com/apache/beam/pull/26413#discussion_r1179442083


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/SelectByteBuddyHelpers.java:
##########
@@ -174,10 +171,13 @@ static RowSelector createRowSelector(SchemaAndDescriptor 
schemaAndDescriptor) {
               .withParameters(Schema.class)
               .intercept(new SelectInstructionConstructor());
 
+      Optional<ClassLoader> rowClassLoader = 
Optional.ofNullable(Row.class.getClassLoader());
+      checkState(rowClassLoader.isPresent());

Review Comment:
   You can get the same effect as your code without going through `Optional` by 
using `org.apache.beam.sdk.util.Preconditions.checkStateNotNull`. Here and in 
the other locations.
   
   (I do prefer to use `Optional` in data structure design rather than null, 
because it is clearer and composes, but in this case it doesn't seem to add 
much)



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