Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2612

Quarkus: non existing nearbyDistanceMeterClass should fail fast the build

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • optaplanner-quarkus
    • None
    • NEW
    • NEW

      This config:

        <localSearch>
          <unionMoveSelector>
            <changeMoveSelector>
              <entitySelector id="entitySelector1"/>
              <valueSelector>
                <nearbySelection>
                  <originEntitySelector mimicSelectorRef="entitySelector1"/>
                  <nearbyDistanceMeterClass>THIS_DOES_NOT_EXIST</nearbyDistanceMeterClass>
                  <parabolicDistributionSizeMaximum>80</parabolicDistributionSizeMaximum>
                </nearbySelection>
              </valueSelector>
            </changeMoveSelector>
      ...
      

      builds fine and gives this exception at runtime:

      java.lang.IllegalArgumentException: The nearbySelectorConfig (NearbySelectionConfig()) is nearby selection but lacks a nearbyDistanceMeterClass (null).

      That's dangerous. Luckily runtime fail on it, but it could have also silently ran - running something differently at runtime than what the user asked for, which is basically lying to the user.

      If optaplanner-quarkus fails to do it's job, for example because that nearbyDistanceMeterClass "THIS_DOES_NOT_EXIST" doesn't exist, it should fail fast during the build already.

              cchianel Christopher Chianelli (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: