diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 3be67c3192..93a7043e4e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1626,6 +1626,9 @@ Release 2.8.0 - UNRELEASED HDFS-9363. Add fetchReplica() to FsDatasetTestUtils to return FsDataset-agnostic replica. (Tony Wu via lei) + HDFS-9377. Fix findbugs warnings in FSDirSnapshotOp. + (Mingliang Liu via Yongjun Zhang) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirSnapshotOp.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirSnapshotOp.java index 41ccfd1604..c565a6aac0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirSnapshotOp.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirSnapshotOp.java @@ -171,8 +171,7 @@ static SnapshotDiffReport getSnapshotDiffReport(FSDirectory fsd, static Collection getSnapshotFiles(FSDirectory fsd, List lsf, String file) throws IOException { - ArrayList snaps = new ArrayList(); - ListIterator sfi = lsf.listIterator(); + ArrayList snaps = new ArrayList<>(); for (DirectorySnapshottableFeature sf : lsf) { // for each snapshottable dir e.g. /dir1, /dir2 final ReadOnlyList lsnap = sf.getSnapshotList();