]> git.mxchange.org Git - jjobs-war.git/blobdiff - src/java/org/mxchange/jjobs/converter/landline/JobsLandLineNumberConverter.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / converter / landline / JobsLandLineNumberConverter.java
index 6f90c0409c750e24e0669e4148160e5ca962e9d2..8c5a57770aae57d85782831a1b38eb6b62093f2f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017, 2018 Free Software Foundation
+ * Copyright (C) 2017 - 2020 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -22,8 +22,8 @@ import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
-import org.mxchange.jjobs.beans.phone.JobsPhoneWebRequestBean;
-import org.mxchange.jjobs.beans.phone.JobsPhoneWebRequestController;
+import org.mxchange.jjobs.beans.phone.list.JobsPhoneListWebViewBean;
+import org.mxchange.jjobs.beans.phone.list.JobsPhoneListWebViewController;
 import org.mxchange.jphone.exceptions.phone.PhoneEntityNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 
@@ -38,21 +38,12 @@ public class JobsLandLineNumberConverter implements Converter<DialableLandLineNu
        /**
         * Phone EJB
         */
-       private static JobsPhoneWebRequestController PHONE_CONTROLLER;
+       private static JobsPhoneListWebViewController PHONE_LIST_CONTROLLER;
 
        @Override
        public DialableLandLineNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Is the instance there?
-               if (null == PHONE_CONTROLLER) {
-                       // Get bean from CDI directly
-                       PHONE_CONTROLLER = CDI.current().select(JobsPhoneWebRequestBean.class).get();
-               }
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
-                       // Warning message
-                       // @TODO Not possible here: this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
                        // Return null
                        return null;
                }
@@ -60,12 +51,18 @@ public class JobsLandLineNumberConverter implements Converter<DialableLandLineNu
                // Init instance
                DialableLandLineNumber landLineNumber = null;
 
+               // Is the instance there?
+               if (null == PHONE_LIST_CONTROLLER) {
+                       // Get bean from CDI directly
+                       PHONE_LIST_CONTROLLER = CDI.current().select(JobssPhoneListWebViewBean.class).get();
+               }
+
                try {
                        // Try to parse the value as long
                        final Long landLineNumberId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       landLineNumber = PHONE_CONTROLLER.findLandLineNumberById(landLineNumberId);
+                       landLineNumber = PHONE_LIST_CONTROLLER.findLandLineNumberById(landLineNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);