From: Roland Häder Date: Sat, 12 Nov 2022 20:26:34 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=65c7743f5c77f03b73ddfb0e4c21b7382bac33ec;p=jcore-swing.git Continued: - avoided method invocation in constructor (can have side-effects?) - updated jar(s) --- diff --git a/lib/jcore.jar b/lib/jcore.jar index e7db928..d21e289 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/src/org/mxchange/jcoreswing/model/BaseModel.java b/src/org/mxchange/jcoreswing/model/BaseModel.java index 74059b1..22939a6 100644 --- a/src/org/mxchange/jcoreswing/model/BaseModel.java +++ b/src/org/mxchange/jcoreswing/model/BaseModel.java @@ -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 + *

+ * @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 diff --git a/src/org/mxchange/jcoreswing/model/swing/contact/ContactTableModel.java b/src/org/mxchange/jcoreswing/model/swing/contact/ContactTableModel.java index e3d681f..4834031 100644 --- a/src/org/mxchange/jcoreswing/model/swing/contact/ContactTableModel.java +++ b/src/org/mxchange/jcoreswing/model/swing/contact/ContactTableModel.java @@ -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