Skip to content

Commit 1b5575e

Browse files
committed
relpcace null check on token with isNotEmpty
1 parent 7a30cb2 commit 1b5575e

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.hadoop.ozone.om.snapshot;
1919

2020
import static java.nio.charset.StandardCharsets.UTF_8;
21-
import static org.apache.commons.lang3.StringUtils.leftPad;
21+
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
2222
import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_DB_PROFILE;
2323
import static org.apache.hadoop.ozone.OzoneAcl.AclScope.DEFAULT;
2424
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_SNAPSHOT_DELETING_SERVICE_INTERVAL;
@@ -2100,7 +2100,7 @@ public void testSnapshotDiffWhenOmRestartAndReportIsPartiallyFetched()
21002100
await(POLL_MAX_WAIT_MILLIS, POLL_INTERVAL_MILLIS,
21012101
() -> cluster.getOzoneManager().isRunning());
21022102

2103-
while (diffReport.getToken() != null) {
2103+
while (isNotEmpty(diffReport.getToken())) {
21042104
diffReport = fetchReportPage(volumeName, bucketName, snapshot1,
21052105
snapshot2, diffReport.getToken(), pageSize);
21062106
diffReportEntries.addAll(diffReport.getDiffList());

hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ public SnapshotDiffReport getSnapshotDiffReport(Path snapshotDir,
703703
SnapshotDiffReportOzone report =
704704
getSnapshotDiffReportOnceComplete(fromSnapshot, toSnapshot, "");
705705
aggregated = report;
706-
while (report.getToken() != null) {
706+
while (StringUtils.isNotEmpty(report.getToken())) {
707707
LOG.info(
708708
"Total Snapshot Diff length between snapshot {} and {} exceeds"
709709
+ " max page size, Performing another " +

hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ public SnapshotDiffReport getSnapshotDiffReport(Path snapshotDir,
13671367
getSnapshotDiffReportOnceComplete(fromSnapshot, toSnapshot, volume,
13681368
bucket, "");
13691369
aggregated = report;
1370-
while (report.getToken() != null) {
1370+
while (StringUtils.isNotEmpty(report.getToken())) {
13711371
LOG.info(
13721372
"Total Snapshot Diff length between snapshot {} and {} exceeds"
13731373
+ " max page size, Performing another" +

0 commit comments

Comments
 (0)