git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
45a64e1
)
JAL-3032 simplified _LoadFileWaitTillLoaded with no thread
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Wed, 20 Jun 2018 15:47:19 +0000
(16:47 +0100)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Wed, 20 Jun 2018 15:47:19 +0000
(16:47 +0100)
src/jalview/io/FileLoader.java
patch
|
blob
|
history
diff --git
a/src/jalview/io/FileLoader.java
b/src/jalview/io/FileLoader.java
index
60db4c8
..
9dd740b
100755
(executable)
--- a/
src/jalview/io/FileLoader.java
+++ b/
src/jalview/io/FileLoader.java
@@
-176,40
+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()
{
-
- /**
- * @j2sNative
- *
- * this.run();
- *
- */
- {
- 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
@@
-225,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;
@@
-235,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());
}
}
}
}