]> git.mxchange.org Git - jjobs-war.git/blobdiff - src/java/org/mxchange/jjobs/beans/features/JobsFeatureWebApplicationBean.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / features / JobsFeatureWebApplicationBean.java
index d0bc78b38bc601b2861a10fce8ed08291ed23dc1..8b452dae645fe8cda08d511ac0425fb2e63f9ccd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * 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
@@ -19,7 +19,7 @@ package org.mxchange.jjobs.beans.features;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Named;
-import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.BaseJobsBean;
 
 /**
  * A feature bean
@@ -28,7 +28,7 @@ import org.mxchange.jjobs.beans.BaseJobsController;
  */
 @Named ("featureController")
 @ApplicationScoped
-public class JobsFeatureWebApplicationBean extends BaseJobsController implements JobsFeaturesWebApplicationController {
+public class JobsFeatureWebApplicationBean extends BaseJobsBean implements JobsFeaturesWebApplicationController {
 
        /**
         * Serial number
@@ -64,18 +64,16 @@ public class JobsFeatureWebApplicationBean extends BaseJobsController implements
                // Default is not enabled
                boolean isEnabled = false;
 
-               // Try it as an NPE may come
-               try {
-                       // Get value from property
-                       String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
+               // Get value from property
+               final String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
 
+               // Is the context parameter found?
+               if (contextParameter instanceof String) {
                        // Is it set?
                        isEnabled = (Boolean.parseBoolean(contextParameter) == Boolean.TRUE);
-               } catch (final NullPointerException ex) {
-                       // Ignored
                }
 
-               // Return value
+               // Return status
                return isEnabled;
        }