cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 6 Oct 2022 23:21:04 +0000 (01:21 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 10 Oct 2022 08:11:38 +0000 (10:11 +0200)
src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
src/main/java/eu/etaxonomy/cdm/vaadin/ui/UserAccountSelfManagementUI.java
src/main/java/eu/etaxonomy/cdm/vaadin/view/LoginPresenter.java
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java

index 7535c2d896320a48e0e8c38ecaae5c40f3744633..11ae4b54b5918fb4ebc0b0687bd8e15acfb698d0 100644 (file)
@@ -323,7 +323,7 @@ public class CdmVaadinConfiguration implements ApplicationContextAware  {
             String activatedVaadinUIs = env.getProperty(CDM_VAADIN_UI_ACTIVATED);
             if(activatedVaadinUIs == null){
                 // not in environment? Read it from the config file!
-                activatedVaadinUIs = appConfig.getProperty(configFile , CDM_VAADIN_UI_ACTIVATED);
+                activatedVaadinUIs = appConfig.getProperty(configFile, CDM_VAADIN_UI_ACTIVATED);
             } else {
                 logger.warn("Active UIs are defined via system properties -D" + CDM_VAADIN_UI_ACTIVATED + "=" +  activatedVaadinUIs + " ignoring config file." );
             }
index 10c509cf6f712a15a1268144c3510fd586bb34d5..a7bdb9d5e482fcbd102966b925e8fb94e6e895f7 100644 (file)
@@ -75,7 +75,4 @@ public class UserAccountSelfManagementUI extends AbstractUI {
             }
         });
     }
-
-
-
-}
+}
\ No newline at end of file
index e5a790995cd96aae0cbe525239c4f55be8302337..40ba8958db94ed274923c886d8ee143de5459afd 100644 (file)
@@ -248,16 +248,17 @@ public class LoginPresenter extends AbstractPresenter<LoginView> implements Even
         logger.debug("UserAccountAction.REGISTER_ACCOUNT for " + servletBaseUrl + ", emailAddress:" + emailAddress);
 
         CountDownLatch finshedSignal = new CountDownLatch(1);
-        List<Throwable> asyncException = new ArrayList<>(1);
-        ListenableFuture<Boolean> futureResult = repo.getAccountRegistrationService().emailAccountRegistrationRequest(emailAddress,
-                servletBaseUrl.toString() + "/app/" + UserAccountSelfManagementUI.NAME + "#!" + AccountRegistrationViewBean.NAME + "/%s");
+        List<Throwable> asyncExceptions = new ArrayList<>(1);
+        String passwordRequestFormUrlTemplate = servletBaseUrl.toString() + "/app/" + UserAccountSelfManagementUI.NAME + "#!" + AccountRegistrationViewBean.NAME + "/%s";
+        ListenableFuture<Boolean> futureResult = repo.getAccountRegistrationService()
+                .emailAccountRegistrationRequest(emailAddress, passwordRequestFormUrlTemplate);
         futureResult.addCallback(
                     successFuture -> {
                         finshedSignal.countDown();
                     },
                     exception -> {
                         // possible MailException
-                        asyncException.add(exception);
+                        asyncExceptions.add(exception);
                         finshedSignal.countDown();
                     }
                 );
@@ -273,13 +274,13 @@ public class LoginPresenter extends AbstractPresenter<LoginView> implements Even
             // than futureResult.addCallback( can be processed, the exception
             // can not be caught asynchronously
             // so we are adding all these exceptions here
-            asyncException.add(e);
+            asyncExceptions.add(e);
         }
-        if(!asyncException.isEmpty()) {
+        if(!asyncExceptions.isEmpty()) {
             getView().getLoginDialog().getRegisterMessageLabel()
-                .setValue("Sending the account registration email to you has failed. Please try again later or contect the support in case this error persists.");
+                .setValue("Sending the account registration email to you has failed. Please try again later or contact the support in case this error persists.");
             getView().getLoginDialog().getRegisterMessageLabel().setStyleName(ValoTheme.LABEL_FAILURE);
-            asyncException.stream().forEach(e->{e.printStackTrace(); logger.error("Error when sending mail: ", e.getMessage());});
+            asyncExceptions.stream().forEach(e->{e.printStackTrace(); logger.error("Error when sending mail: ", e.getMessage());});
          } else {
             if(!asyncTimeout && result) {
                 getView().getLoginDialog().getRegisterMessageLabel().setValue("An email with with further instructions has been sent to you.");
@@ -293,5 +294,4 @@ public class LoginPresenter extends AbstractPresenter<LoginView> implements Even
             }
         }
     }
-
 }
index cd3476e95cc2e187c2329e42076eb1f1f728563f..e6b3ca5b4efd1f0bdfa525fc549ec6f9aaa6e83f 100644 (file)
@@ -82,11 +82,11 @@ import eu.etaxonomy.vaadin.mvp.AbstractCdmDTOPopupEditor;
  */
 @SpringComponent
 @Scope("prototype")
-public class TaxonNamePopupEditor extends AbstractCdmDTOPopupEditor<TaxonNameDTO, TaxonName, TaxonNameEditorPresenter>
-    implements TaxonNamePopupEditorView{
+public class TaxonNamePopupEditor
+        extends AbstractCdmDTOPopupEditor<TaxonNameDTO, TaxonName, TaxonNameEditorPresenter>
+        implements TaxonNamePopupEditorView{
 
     private static final long serialVersionUID = -7037436241474466359L;
-
     private final static Logger logger = LogManager.getLogger();
 
     private final static int GRID_COLS = 4;
index 3e63c972c8ce6f5b61158b717991b05e479ac557..d1a8e96c9ddf67077a21ec1f92e8d146e33a0f09 100644 (file)
@@ -433,7 +433,6 @@ public abstract class AbstractPopupEditor<DTO extends Object, P extends Abstract
                 }
                 throw new RuntimeException(e);
             }
-
         }
     }