From 65c7743f5c77f03b73ddfb0e4c21b7382bac33ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 12 Nov 2022 21:26:34 +0100 Subject: [PATCH] Continued: - avoided method invocation in constructor (can have side-effects?) - updated jar(s) --- lib/jcore.jar | Bin 13638 -> 14510 bytes .../mxchange/jcoreswing/model/BaseModel.java | 14 ++++++++++++++ .../swing/contact/ContactTableModel.java | 10 ++-------- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/jcore.jar b/lib/jcore.jar index e7db928824e824f8281c0b322260f68bc7e93acc..d21e289534624e1161e0cc57f66d123f56242bc9 100644 GIT binary patch delta 3201 zcmaJ^ZA@F|6@K39k85A90ULh+CgAW9z{c1nlqEnzlC?=Q0wg1}`Cc93rUVBXKGJF0 z>d|(cqDGpMxBbycYkw@twzTV5$skJ9CXuE|`;PXblh!|zx~;$3wbHa7lh*E>_ZqM* zvMXJ`U*|l}dCz;!d9QzU_U-eY1A{iZ0k{D7o7u~rHm~c=?AYIO&%QVXfM37-Sv++4 z#J*5ZY+L-9>DjsXBbieZ>8W_?bmmklHGg?IVcSxd71*z1%!S8!=?Pvs ztmBA|qf3*vyF#X&ZC=mlTzY(RDE-W#^r>t{$1&ONcuWpgCa>sQ5P2cu_BMU9xAIv*hDpI1ghotjB1C8HnhuNTT@s0Q%W*2F&mkh&t`eyxQPfh zo2bJk6ZL2?F@T*WPN3h!7PQK+J0%aghg<_VX<`?4%actpx!b#0-tP#=rrK(c`%GqT zbZ%y1>Wo0A{LEb?|KQN&D@G_6B<~3L;DEvAkh2YtZPaQ^r&?lEE!jYAIoxPO6KOTm zsE%5G?C(G_kg5xWM@Z8(qk^cA@7L}R~z`{%T1Qw9cU z!$6wUPt$guLKV)^_9qoVP=VxX@(hH>-Y1SuQmKIWf}}MaK^+O25J)1GHy}YRyTcK^ z0fW7v6?kL1zTc8VDH&8BHM6OtSZUb#Qy75q6dk1mx-krSBGTx}gZK&CA(RQCJ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;z7rUdWLc}%y z9rPJ#wErhgE^Jya$;qafV9j}DL02~W9o~CP2fdn`#NI9Oa<|!;62Cl_+KA#{InG@o^0SzDi)t zC&1iaEm>jCGH(tCfAHmd4Q~>Vx5cyO;qczBbOYdwhT3{!gM;y|bx+rCyh1SEYUe>~ z`~vEZCa|uI9Cof$KkI#McsNY|Zr)bT1MFNd1JDZmY*o1q=>2xv$X#ORZPh%$-Rv2_ zh3rgr(g4&q?)YVxlz9ux1Jvaapi)G`U*VTc3u&3jrgE)pYlR;CJ`y)C610c%3)!^_ eJ$65kcq}NyuF6QVh5s?Aa?)^{YJVMnCh;#spQO$J 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 -- 2.39.5