ref #6321 Wait for previous search to finish
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 14 Aug 2018 18:31:30 +0000 (20:31 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 14 Aug 2018 19:22:56 +0000 (21:22 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java

index b31a10377a86fcc80e343665d4cc0f6f430fec49..51a806a531ab9b7530acdb46bdc0a81a02331237 100644 (file)
@@ -158,6 +158,17 @@ public abstract class AbstractBulkEditorInput<T extends CdmBase> extends CdmEnti
            if(searchJob!=null && searchJob.getState()!=Job.NONE){
                searchJob.cancel();
                searchJob = null;
+               /*
+                * wait for a little while for the job to finish
+                * to avoid asynchronously loaded results of the
+                * previous search being shown in the next search
+                * (not critical but explicitly waiting for the job to finish
+                * could run into an endless loop by mistake)
+                */
+               try {
+                Thread.sleep(500);
+            } catch (InterruptedException e) {
+            }
            }
            model.clear();