uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: SwingWorker class in uimaj-tools
Date Wed, 10 Jun 2009 14:58:34 GMT
Hi,

On Wed, Jun 10, 2009 at 4:14 PM, Thilo Goetz<twgoetz@gmx.de> wrote:
> It's used only in one place in our code. Maybe it could be eliminated.

Based on a quick look it seems like the whole SwingWorker class is
overkill for this usage since the get() method is never called. A
normal Thread should do just fine, see the patch below.

BR,

Jukka Zitting

Index: uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java
===================================================================
--- uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java	(Revision
783374)
+++ uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java	(Arbeitskopie)
@@ -707,11 +707,10 @@
       statusLabel.setText("Initializing");
       // logDialog.clear();
       progressBar.setValue(0);
-
-      final SwingWorker worker = new SwingWorker() {
-        public Object construct() {
-          startProcessing();
-          return null;
+
+      Thread worker = new Thread() {
+        public void run() {
+          startProcessing();
         }
       };
       worker.start();

Mime
View raw message