From 7ffbd8cdfcf79249cf16df75c55ed3930e584a4b Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Tue, 8 Jan 2019 23:22:10 +0000 Subject: [PATCH] JAL-3141 Made some more suggested changes from code review --- src/jalview/io/BackupFiles.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 28eefd6..c58a714 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -8,6 +8,7 @@ import jalview.util.MessageManager; import java.io.File; import java.io.IOException; import java.util.Arrays; +import java.util.Map; import java.util.HashMap; import java.util.TreeMap; @@ -263,7 +264,7 @@ public class BackupFiles // sort the backup files (based on integer found in the suffix) using a // precomputed Hashmap for speed - HashMap bfHashMap = new HashMap<>(); + Map bfHashMap = new HashMap<>(); for (int i = 0; i < backupFiles.length; i++) { File f = backupFiles[i]; @@ -465,7 +466,7 @@ public class BackupFiles return rename; } - public static TreeMap lsBackupFilesAsTreeMap( + public static TreeMap getBackupFilesAsTreeMap( String fileName, String suffix, int digits) { @@ -504,7 +505,7 @@ public class BackupFiles // sort the backup files (based on integer found in the suffix) using a // precomputed Hashmap for speed - HashMap bfHashMap = new HashMap<>(); + Map bfHashMap = new HashMap<>(); for (int i = 0; i < backupFiles.length; i++) { File f = backupFiles[i]; @@ -518,10 +519,10 @@ public class BackupFiles return bfTreeMap; } - public static File[] lsBackupFiles(String fileName, String suffix, + public static File[] getBackupFiles(String fileName, String suffix, int digits) { - TreeMap bfTreeMap = lsBackupFilesAsTreeMap(fileName, + TreeMap bfTreeMap = getBackupFilesAsTreeMap(fileName, suffix, digits); File[] backupFiles = new File[bfTreeMap.size()]; bfTreeMap.values().toArray(backupFiles); -- 1.7.10.2