git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'Jalview-BH/JAL-3026' into tasks/JAL-3033_jalviewjs_ant
[jalview.git]
/
src
/
jalview
/
io
/
FileLoader.java
diff --git
a/src/jalview/io/FileLoader.java
b/src/jalview/io/FileLoader.java
index
26641b1
..
9dd740b
100755
(executable)
--- 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()
{
*
* @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()
{
return alignFrame;
}
public void updateRecentlyOpened()
{
- Vector recent = new Vector();
+ Vector<String> recent = new Vector<>();
if (protocol == DataSourceType.PASTE)
{
// do nothing if the file was pasted in as text... there is no filename to
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 type = protocol == DataSourceType.FILE ? "RECENT_FILE"
: "RECENT_URL";
- String historyItems = jalview.bin.Cache.getProperty(type);
+ String historyItems = Cache.getProperty(type);
StringTokenizer st;
StringTokenizer st;
@@
-227,7
+215,7
@@
public class FileLoader implements Runnable
while (st.hasMoreTokens())
{
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();
}
return tempStructFile.toString();
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#finalize()
- */
- @Override
- protected void finalize() throws Throwable
- {
- source = null;
- alignFrame = null;
- viewport = null;
- super.finalize();
- }
-
}
}