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


##########
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:
   in other words, checkerframework doesn't understand that by using this 
method (and getting a false returned from it) we've just asserted, that the 
variable is `@NonNull` - my "polyfill" method uses the checkerframework's 
annotation:
   ```
     @EnsuresNonNullIf(
         expression = {"#1"},
         result = false)
   ``` 
   which tells it that if it returns false the first argument is verified to be 
`@NonNull` - I don't know why checkerframwork doesn't understand guava method's 
postconditions here (maybe it's fixed in some newer version?)    



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