From: Ben Soares Date: Wed, 9 Jan 2019 18:29:05 +0000 (+0000) Subject: JAL-3141 removed redundant method to tests X-Git-Tag: Release_2_11_0~17^2~97^2~34 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5e183aa333880dfe2bab2a383950042d722dc217;p=jalview.git JAL-3141 removed redundant method to tests --- diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 9209d72..3fc57fc 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -527,15 +527,6 @@ public class BackupFiles return bfTreeMap; } - public static File[] getBackupFiles(String fileName, String suffix, - int digits) - { - TreeMap bfTreeMap = getBackupFilesAsTreeMap(fileName, - suffix, digits); - File[] backupFiles = new File[bfTreeMap.size()]; - bfTreeMap.values().toArray(backupFiles); - return backupFiles; - } } diff --git a/test/jalview/io/BackupFilesTest.java b/test/jalview/io/BackupFilesTest.java index a78936e..ebdf26a 100644 --- a/test/jalview/io/BackupFilesTest.java +++ b/test/jalview/io/BackupFilesTest.java @@ -272,7 +272,7 @@ public class BackupFilesTest { newfile.delete(); } - File[] tmpFiles = BackupFiles.lsBackupFiles(newFile, suffix, digits); + File[] tmpFiles = getBackupFiles(newFile, suffix, digits); for (int i = 0; i < tmpFiles.length; i++) { if (actuallyDeleteTmpFiles) @@ -286,15 +286,24 @@ public class BackupFilesTest } } + private static File[] getBackupFiles(String f, String s, int i) + { + TreeMap bfTreeMap = BackupFiles.getBackupFilesAsTreeMap(f, + s, i); + File[] backupFiles = new File[bfTreeMap.size()]; + bfTreeMap.values().toArray(backupFiles); + return backupFiles; + } + private static File[] getBackupFiles() { - return BackupFiles.lsBackupFiles(newFile, suffix, digits); + return getBackupFiles(newFile, suffix, digits); } private static boolean checkBackupFiles(HashMap indexmap) throws IOException { - TreeMap map = BackupFiles.lsBackupFilesAsTreeMap(newFile, + TreeMap map = BackupFiles.getBackupFilesAsTreeMap(newFile, suffix, digits); Enumeration indexesenum = Collections .enumeration(indexmap.keySet()); @@ -332,7 +341,7 @@ public class BackupFilesTest private static boolean checkBackupFiles(int[] indexes) throws IOException { - TreeMap map = BackupFiles.lsBackupFilesAsTreeMap(newFile, + TreeMap map = BackupFiles.getBackupFilesAsTreeMap(newFile, suffix, digits); for (int m = 0; m < indexes.length; m++) { @@ -372,7 +381,7 @@ public class BackupFilesTest private static String[] getBackupFilesAsStrings() { - File[] files = BackupFiles.lsBackupFiles(newFile, suffix, digits); + File[] files = getBackupFiles(newFile, suffix, digits); String[] filenames = new String[files.length]; for (int i = 0; i < files.length; i++) {