]> git.mxchange.org Git - jcore.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 12 Nov 2022 21:04:45 +0000 (22:04 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 12 Nov 2022 21:10:42 +0000 (22:10 +0100)
- avoided invoking method in constructor as this has side-effects (?)
- sorted members

src/org/mxchange/jcore/BaseFrameworkSystem.java
src/org/mxchange/jcore/facade/BaseFacade.java
src/org/mxchange/jcore/manager/application/ApplicationManager.java

index 55547f5bfa82e4e0f7f6390b42dfb7617e8e30d7..78957734eaa183464c5ee03870f8b7dd3a2623e0 100644 (file)
@@ -87,6 +87,25 @@ public abstract class BaseFrameworkSystem implements FrameworkInterface {
        protected BaseFrameworkSystem () {
        }
 
+       /**
+        * Constructor with Application instance
+        * <p>
+        * @param application Application instance
+        */
+       protected BaseFrameworkSystem (final Application application) {
+               // Call other constructor
+               this();
+
+               // Application instance must be set
+               if (null == application) {
+                       // Abort here
+                       throw new NullPointerException("application is null"); //NOI18N
+               }
+
+               // Set application instance
+               this.application = application;
+       }
+
        /**
         * Constructor with a facade
         * <p>
index 3c45b98853b2001bb6f7cdf34961a3d063bfe5db..93b8b628e77dc13d4f77cae0fe6cab523fb4e96c 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jcore.facade;
 
 import org.mxchange.jcore.BaseFrameworkSystem;
+import org.mxchange.jcore.application.Application;
 
 /**
  * A general manager
@@ -32,4 +33,14 @@ public abstract class BaseFacade extends BaseFrameworkSystem implements Facade {
        protected BaseFacade () {
        }
 
+       /**
+        * Constructor with Application instance
+        * <p>
+        * @param application Application instance
+        */
+       protected BaseFacade (final Application application) {
+               // Call other constructor
+               super(application);
+       }
+
 }
index b439ebc90e7b4e4ebabdb2f61d65419b889c292e..54b1a0e23597b9c1e4d9913485faeea1caedf321 100644 (file)
@@ -62,14 +62,8 @@ public class ApplicationManager extends BaseFacade implements ManageableApplicat
         * @param application An instance of an Application class
         */
        private ApplicationManager (final Application application) {
-               // Application instance must be set
-               if (null == application) {
-                       // Abort here
-                       throw new NullPointerException("application is null"); //NOI18N
-               }
-
-               // Set application instance
-               this.setApplication(application);
+               // Invoke super constructor
+               super(application);
        }
 
        @Override