summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoop Talasila <talasila@research.att.com>2019-03-12 14:28:24 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-12 14:28:24 +0000
commitd68fd747192c9f492bb0be74195ce1f7b4b76bc1 (patch)
treec67d7aedd08aea482aef438c910f36107791c667
parentc41e285f810412f9ef79ae066c546f4de5a7adee (diff)
parent073c1d3bd5f175f4fe6f4d71bec7d903970c1395 (diff)
Merge "refactor in SwingWorker.java"
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/utils/SwingWorker.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/utils/SwingWorker.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/utils/SwingWorker.java
index 5058c064..a18cdc1c 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/utils/SwingWorker.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/utils/SwingWorker.java
@@ -53,7 +53,6 @@ import javax.swing.SwingUtilities;
*/
public abstract class SwingWorker {
private Object value; // see getValue(), setValue()
- private Thread thread;
/**
* Class to maintain reference to current worker thread
@@ -136,21 +135,17 @@ public abstract class SwingWorker {
* and then exit.
*/
public SwingWorker() {
- final Runnable doFinished = new Runnable() {
- public void run() { finished(); }
- };
-
- Runnable doConstruct = new Runnable() {
- public void run() {
- try {
- setValue(construct());
- }
- finally {
- threadVar.clear();
- }
+ final Runnable doFinished = () -> finished();
- SwingUtilities.invokeLater(doFinished);
+ Runnable doConstruct = () -> {
+ try {
+ setValue(construct());
}
+ finally {
+ threadVar.clear();
+ }
+
+ SwingUtilities.invokeLater(doFinished);
};
Thread t = new Thread(doConstruct);