X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FFileLoader.java;h=9dd740b3a470d2363b49acb823a5183d4c5cf8fc;hb=298d676e11b2664a99a56b6c1d2a216e40727e9e;hp=26641b10ea1c0ce51ded38d125a44dec3483bfba;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 26641b1..9dd740b 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -176,32 +176,20 @@ public class FileLoader implements Runnable } /** - * start thread and wait until finished, then return the alignFrame that's - * (hopefully) been read. + * runs the 'run' method (in this thread), then return the alignFrame that's + * (hopefully) been read * * @return */ protected AlignFrame _LoadFileWaitTillLoaded() { - Thread loader = new Thread(this); - loader.start(); - - while (loader.isAlive()) - { - try - { - Thread.sleep(500); - } catch (Exception ex) - { - } - } - + this.run(); return alignFrame; } public void updateRecentlyOpened() { - Vector recent = new Vector(); + Vector recent = new Vector<>(); if (protocol == DataSourceType.PASTE) { // do nothing if the file was pasted in as text... there is no filename to @@ -217,7 +205,7 @@ public class FileLoader implements Runnable String type = protocol == DataSourceType.FILE ? "RECENT_FILE" : "RECENT_URL"; - String historyItems = jalview.bin.Cache.getProperty(type); + String historyItems = Cache.getProperty(type); StringTokenizer st; @@ -227,7 +215,7 @@ public class FileLoader implements Runnable while (st.hasMoreTokens()) { - recent.addElement(st.nextElement().toString().trim()); + recent.addElement(st.nextToken().trim()); } } @@ -606,18 +594,4 @@ public class FileLoader implements Runnable return tempStructFile.toString(); } - /* - * (non-Javadoc) - * - * @see java.lang.Object#finalize() - */ - @Override - protected void finalize() throws Throwable - { - source = null; - alignFrame = null; - viewport = null; - super.finalize(); - } - }