summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics/src/main
diff options
context:
space:
mode:
authorPawel <pawel.kasperkiewicz@nokia.com>2019-02-19 06:53:17 -0500
committerPawel <pawel.kasperkiewicz@nokia.com>2019-02-19 06:53:17 -0500
commit073c1d3bd5f175f4fe6f4d71bec7d903970c1395 (patch)
treee102e07d36a8f5d7c18c7b5b79522cf0c78f285d /ecomp-sdk/epsdk-analytics/src/main
parent7b740b078f8fb593c2615e8b6689d30ea46a0c86 (diff)
refactor in SwingWorker.java
Issue-ID: PORTAL-525 Change-Id: I87ecdf2cf2504c6ca15090e3f3e3483cde23d956 Signed-off-by: Pawel <pawel.kasperkiewicz@nokia.com>
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main')
-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);