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


##########
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/gcsfs/GcsPath.java:
##########
@@ -233,6 +235,9 @@ public void setFileSystem(FileSystem fs) {
   }
 
   @Override
+  // fs is null for paths not attached to a filesystem (e.g. created via 
fromUri/fromComponents);
+  // returning it preserves prior behavior. Path.getFileSystem is not 
annotated for nullness.
+  @SuppressWarnings("nullness")

Review Comment:
   Based on the comment, we can have the `@SuppressWarnings("nullness")` but 
should also make the return value `@Nullable` so that downstream consumers will 
know to check for null.



##########
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtilV1.java:
##########
@@ -828,6 +841,9 @@ void verifyBucketAccessible(GcsPath path, BackOff backoff, 
Sleeper sleeper) thro
     getBucket(path, backoff, sleeper);
   }
 
+  // AccessDeniedException permits a null "other" argument and these 
exceptions permit a null detail
+  // message, but the JDK constructor stubs are not annotated for nullness.
+  @SuppressWarnings("nullness")

Review Comment:
   How about a small helper method like this, to narrow the scope of the 
suppression. Can reuse in all the methods below as well.
   
   ```
   @SuppressWarnings("nullness")
   private AccessDeniedException createAccessDeniedException(path, message) [
     return new AccessDeniedException(path, null, message)
   }
   ```



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