From 073c1d3bd5f175f4fe6f4d71bec7d903970c1395 Mon Sep 17 00:00:00 2001 From: Pawel Date: Tue, 19 Feb 2019 06:53:17 -0500 Subject: refactor in SwingWorker.java Issue-ID: PORTAL-525 Change-Id: I87ecdf2cf2504c6ca15090e3f3e3483cde23d956 Signed-off-by: Pawel --- .../analytics/gmap/utils/SwingWorker.java | 23 +++++++++------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'ecomp-sdk/epsdk-analytics') 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); -- cgit 1.2.3-korg