tilgalas commented on code in PR #32081:
URL: https://github.com/apache/beam/pull/32081#discussion_r1816501746


##########
sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java:
##########
@@ -486,10 +518,17 @@ public static Schema toBeamSchema(org.apache.avro.Schema 
schema) {
     return builder.build();
   }
 
+  @EnsuresNonNullIf(
+      expression = {"#1"},
+      result = false)
+  private static boolean isNullOrEmpty(@Nullable String str) {
+    return str == null || str.isEmpty();
+  }

Review Comment:
   for some reason the checkerframework doesn't understand the nullness 
assertion when using it:
   ```
   
/usr/local/google/home/mszwaja/src/beam/sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java:538:
 error: [argument] incompatible argument for parameter namespace of 
AvroUtils.toAvroField.
         org.apache.avro.Schema.Field recordField = toAvroField(field, 
childNamespace);
                                                                       ^
     found   : @Initialized @Nullable String
     required: @Initialized @NonNull String
   
/usr/local/google/home/mszwaja/src/beam/sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java:541:
 error: [argument] incompatible argument for parameter name of 
Schema.createRecord.
       return org.apache.avro.Schema.createRecord(schemaName, "", 
schemaNamespace, false, fields);
                                                  ^
     found   : @Initialized @Nullable String
     required: @Initialized @NonNull String
     ```



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