]> git.mxchange.org Git - jjobs-war.git/blobdiff - src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / phone / JobsAdminPhoneWebRequestBean.java
index a63a571372bb32fd8475b4f1745214caf958921e..cc089f358f34a7e3053ee42822d7b13ad46d330c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 - 2018 Free Software Foundation
+ * Copyright (C) 2016 - 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
@@ -25,6 +25,7 @@ import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
+import javax.faces.application.FacesMessage;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcountry.model.data.Country;
@@ -538,7 +539,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd
                // Is the mobile provider and number the same?
                if ((Objects.equals(this.getPhoneCountry(), number.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), number.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) {
                        // Show message
-                       this.showFacesMessage("form_edit_fax:faxNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
+                       this.showFacesMessage("form_edit_fax:faxNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED", FacesMessage.SEVERITY_WARN); //NOI18N
 
                        // No difference in both together, no need to edit
                        return ""; //NOI18N
@@ -604,7 +605,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd
                // Is the mobile provider and number the same?
                if ((Objects.equals(this.getPhoneCountry(), number.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), number.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) {
                        // Show message
-                       this.showFacesMessage("form_edit_landline:landLineNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
+                       this.showFacesMessage("form_edit_landline:landLineNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED", FacesMessage.SEVERITY_WARN); //NOI18N
 
                        // No difference in both together, no need to edit
                        return ""; //NOI18N
@@ -660,9 +661,8 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd
                        // Throw NPE again
                        throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
                } else if (this.getMobileProvider() == null) {
-                       // Not provided
-                       this.showFacesMessage("form_edit_mobile:mobileProvider", "ERROR_ADMIN_NO_MOBILE_PROVIDER_SELECTED"); //NOI18N
-                       return ""; //NOI18N
+                       // Throw NPE again
+                       throw new NullPointerException("this.mobileProvider is null"); //NOI18N
                } else if (this.getMobileProvider().getProviderId() == null) {
                        // Throw NPE again ...
                        throw new NullPointerException("this.mobileProvider.providerId is null"); //NOI18N
@@ -670,15 +670,14 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("this.mobileProvider.providerId={0} is not valid.", this.getMobileProvider().getProviderId())); //NOI18N
                } else if (this.getPhoneNumber() == null) {
-                       // Not provided
-                       this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_EMPTY_MOBILE_NUMBER"); //NOI18N
-                       return ""; //NOI18N
+                       // Throw NPE
+                       throw new NullPointerException("this.phoneNumber is null"); //NOI18N
                }
 
                // Is the mobile provider and number the same?
                if ((Objects.equals(this.getMobileProvider(), number.getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) {
                        // Show message
-                       this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
+                       this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED", FacesMessage.SEVERITY_WARN); //NOI18N
 
                        // No difference in both together, no need to edit
                        return ""; //NOI18N