HDFS-9377. Fix findbugs warnings in FSDirSnapshotOp. (Mingliang Liu via Yongjun Zhang)

This commit is contained in:
Yongjun Zhang 2015-11-05 14:36:12 -08:00
parent 21c0e3eda5
commit 286cc6483f
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -171,8 +171,7 @@ static SnapshotDiffReport getSnapshotDiffReport(FSDirectory fsd,
static Collection<String> getSnapshotFiles(FSDirectory fsd,
List<DirectorySnapshottableFeature> lsf,
String file) throws IOException {
ArrayList<String> snaps = new ArrayList<String>();
ListIterator<DirectorySnapshottableFeature> sfi = lsf.listIterator();
ArrayList<String> snaps = new ArrayList<>();
for (DirectorySnapshottableFeature sf : lsf) {
// for each snapshottable dir e.g. /dir1, /dir2
final ReadOnlyList<Snapshot> lsnap = sf.getSnapshotList();