cid#1487032 NP: Null pointer dereference

and

cid#1487033 UwF: Unwritten field

since...

commit 822f128e734f37ee4de9bf5b62640cbec140701e
Date:   Wed Jul 7 16:01:19 2021 +0300

    Polymorphism is a better approach when there are chains of inheritance.

where deGTBehavior and psGTBehavior are no longer stored when set from
DEPSSolverImpl.java:146 and DEPSSolverImpl.java:147

Change-Id: If3d228bf6e5f2b1ddd119d75b55bd778bcce8b05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118759
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
index 88aa56e..adc6a75 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
@@ -101,6 +101,17 @@ public class DEPSAgent implements ILibEngine {

  public void setGTBehavior(AbsGTBehavior gtBehavior) {
    gtBehavior.setMemPoints(pbest_t, pcurrent_t, pold_t);

    // see getGTBehavior and setLibrary for uses of
    // deGTBehavior and psGTBehavior
    if (gtBehavior instanceof DEGTBehavior) {
      deGTBehavior = ((DEGTBehavior) gtBehavior);
      return;
    }
    if (gtBehavior instanceof PSGTBehavior) {
      psGTBehavior = ((PSGTBehavior) gtBehavior);
      return;
    }
  }

  public void generatePoint() {