]> git.mxchange.org Git - jcore-swing.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 12 Nov 2022 20:26:34 +0000 (21:26 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 12 Nov 2022 20:26:34 +0000 (21:26 +0100)
- avoided method invocation in constructor (can have side-effects?)
- updated jar(s)

lib/jcore.jar
src/org/mxchange/jcoreswing/model/BaseModel.java
src/org/mxchange/jcoreswing/model/swing/contact/ContactTableModel.java

index e7db928824e824f8281c0b322260f68bc7e93acc..d21e289534624e1161e0cc57f66d123f56242bc9 100644 (file)
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
index 74059b1ec7611ec281991d207eb3a66eb2a24abf..22939a61b74f6de63c63243760490a034a96237e 100644 (file)
@@ -20,6 +20,7 @@ import javax.swing.event.EventListenerList;
 import javax.swing.event.ListDataListener;
 import javax.swing.event.TableModelListener;
 import org.mxchange.jcore.BaseFrameworkSystem;
+import org.mxchange.jcore.facade.Facade;
 
 /**
  * A general model class
@@ -41,6 +42,19 @@ public abstract class BaseModel extends BaseFrameworkSystem implements Model {
                this.eventListenerList = new EventListenerList();
        }
 
+       /**
+        * Constructor with a facade
+        * <p>
+        * @param facade Facade instance
+        */
+       protected BaseModel (final Facade facade) {
+               // Call super constructor
+               super(facade);
+
+               // Init listener list
+               this.eventListenerList = new EventListenerList();
+       }
+
        @Override
        public void addListDataListener (final ListDataListener listener) {
                // Listener must not be null
index e3d681fc9dfa4955cf5c43165ba01af608251cd2..483403139e31d8f629b1dc2a0f90da47568a0c8c 100644 (file)
@@ -36,14 +36,8 @@ public class ContactTableModel extends BaseModel implements Model, TableModel {
         * @param facade Facade instance
         */
        public ContactTableModel (final Facade facade) {
-               // Facade must not be null
-               if (null == facade) {
-                       // Abort here
-                       throw new NullPointerException("facade is null"); //NOI18N
-               }
-
-               // Set manager
-               this.setFacade(facade);
+               // Invoke parent constructor
+               super(facade);
        }
 
        @Override