adoroszlai commented on code in PR #9132:
URL: https://github.com/apache/ozone/pull/9132#discussion_r2555361022
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java:
##########
@@ -115,14 +120,26 @@ public void testDownloadCheckpoint() throws Exception {
"does not match its ratis snapshot index");
}
+ @SuppressFBWarnings("NP")
Review Comment:
Try:
```diff
diff --git
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java
index 4a1068b4fe..5b5530cfeb 100644
---
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java
+++
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java
@@ -18,10 +18,10 @@
package org.apache.hadoop.ozone.om.snapshot;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.Objects;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.utils.IOUtils;
@@ -121,14 +121,13 @@ public void testDownloadCheckpoint() throws Exception {
private long getDownloadedSnapshotIndex(DBCheckpoint dbCheckpoint)
throws Exception {
- Path checkpointLocation = Objects.requireNonNull(
- dbCheckpoint.getCheckpointLocation(),
- "checkpoint location is null");
+ Path checkpointLocation = dbCheckpoint.getCheckpointLocation();
+ assertNotNull(checkpointLocation);
OmSnapshotUtils.createHardLinks(checkpointLocation, true);
- Path parent = Objects.requireNonNull(
- checkpointLocation.getParent(),
- "checkpoint parent is null");
+
+ Path parent = checkpointLocation.getParent();
+ assertNotNull(parent);
Path omDbLocation = Paths.get(parent.toString(),
OzoneConsts.OM_CHECKPOINT_DATA_DIR,
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]