• Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 8.14.0.Final
    • 8.7.0.Final
    • optaplanner-core
    • None

      Imagine the following constraint:

      constraintFactory.from(Cluster.class)
                      .ifExists(Pod.class, 
                         Joiners.equal(Function.identity(), pod -> pod.getNode().getCluster()))
      

      The constraint throws a NPE as pod.getNode() is null, because pod is the PlanningEntity and its reference to Node is the PlanningVariable.

      In this context, the ifExists() behaves like fromUnfiltered(), without any option to avoid the uninitialized planning entities.

              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              rsynek@redhat.com Radovan Synek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: