cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 1 Jun 2021 13:20:38 +0000 (15:20 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 1 Jun 2021 13:20:38 +0000 (15:20 +0200)
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/server/RemotingLoginDialogLocal.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java

index c82539ebc6e5961c19314d1e54a4f6ddc38fdfd9..da718cca50686d07087c48a60c5ed9967c3378a9 100755 (executable)
@@ -653,32 +653,29 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog implements ICd
                             selectedServerInfo.refreshInstances();
                         }
                         final List<CdmInstanceInfo> instances = selectedServerInfo.getInstances();
-                        Display.getDefault().asyncExec(new Runnable() {
-                            @Override
-                            public void run() {
-                                if(!instances.isEmpty()) {
-                                    for(CdmInstanceInfo cdmInstance : instances) {
-                                        comboCdmInstance.add(cdmInstance.getName());
-                                    }
-                                    int instanceIndex = -1;
-                                    if(instanceName != null) {
-                                        instanceIndex = comboCdmInstance.indexOf(instanceName);
-                                    }
-                                    if(instanceIndex == -1) {
-                                        comboCdmInstance.select(0);
-                                        autoConnect = false;
-                                    } else {
-                                        comboCdmInstance.select(instanceIndex);
-                                    }
-                                    onRefreshCdmInstance();
-                                    comboCdmInstance.setEnabled(true);
-                                    if(autoConnect) {
-                                        connect();
-                                    }
+                        Display.getDefault().asyncExec(()->{
+                            if(!instances.isEmpty()) {
+                                for(CdmInstanceInfo cdmInstance : instances) {
+                                    comboCdmInstance.add(cdmInstance.getName());
+                                }
+                                int instanceIndex = -1;
+                                if(instanceName != null) {
+                                    instanceIndex = comboCdmInstance.indexOf(instanceName);
+                                }
+                                if(instanceIndex == -1) {
+                                    comboCdmInstance.select(0);
+                                    autoConnect = false;
                                 } else {
-                                    txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES);
-                                    btnConnect.setEnabled(false);
+                                    comboCdmInstance.select(instanceIndex);
+                                }
+                                onRefreshCdmInstance();
+                                comboCdmInstance.setEnabled(true);
+                                if(autoConnect) {
+                                    connect();
                                 }
+                            } else {
+                                txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES);
+                                btnConnect.setEnabled(false);
                             }
                         });
                     }
index 182cd5b015b619b7d0eede93329514632f19a87e..d0de9752d9a9afb6721eebf9a639efb40ccc8598 100644 (file)
@@ -315,7 +315,7 @@ public class MessagingUtils {
         // We need to build a MultiStatus object since the simple
         // idea of writing out the stack trace as a single string
         // leads to a single line on windows
-        List<Status> childStatuses = new ArrayList<Status>();
+        List<Status> childStatuses = new ArrayList<>();
 
         // add context info
         List<String> contextInfo = getContextInfo();
index aee8901152a7e06239e2e704c6a64a22bee7fd4d..78f95581ae6747e3628992c5cb10bf73bc654a0f 100644 (file)
@@ -513,11 +513,6 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
 
     }
 
-
-
-
-
-
     @SuppressWarnings("unused")
     private void addEmptyCells(int cnt) {
         for (int i = 0; i < cnt; i++) {
@@ -699,32 +694,29 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
                             selectedServerInfo.refreshInstances();
                         }
                         final List<CdmInstanceInfo> instances = selectedServerInfo.getInstances();
-                        Display.getDefault().asyncExec(new Runnable() {
-                            @Override
-                            public void run() {
-                                if(!instances.isEmpty()) {
-                                    for(CdmInstanceInfo cdmInstance : instances) {
-                                        comboCdmInstance.add(cdmInstance.getName());
-                                    }
-                                    int instanceIndex = -1;
-                                    if(getInstanceName() != null) {
-                                        instanceIndex = comboCdmInstance.indexOf(getInstanceName());
-                                    }
-                                    if(instanceIndex == -1) {
-                                        comboCdmInstance.select(0);
-                                        setAutoConnect(false);
-                                    } else {
-                                        comboCdmInstance.select(instanceIndex);
-                                    }
-                                    onRefreshCdmInstance();
-                                    comboCdmInstance.setEnabled(true);
-                                    if(isAutoConnect()) {
-                                        connect();
-                                    }
+                        Display.getDefault().asyncExec(()->{
+                            if(!instances.isEmpty()) {
+                                for(CdmInstanceInfo cdmInstance : instances) {
+                                    comboCdmInstance.add(cdmInstance.getName());
+                                }
+                                int instanceIndex = -1;
+                                if(getInstanceName() != null) {
+                                    instanceIndex = comboCdmInstance.indexOf(getInstanceName());
+                                }
+                                if(instanceIndex == -1) {
+                                    comboCdmInstance.select(0);
+                                    setAutoConnect(false);
                                 } else {
-                                    txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES);
-                                    btnConnect.setEnabled(false);
+                                    comboCdmInstance.select(instanceIndex);
+                                }
+                                onRefreshCdmInstance();
+                                comboCdmInstance.setEnabled(true);
+                                if(isAutoConnect()) {
+                                    connect();
                                 }
+                            } else {
+                                txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES);
+                                btnConnect.setEnabled(false);
                             }
                         });
                     }