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

@ShadowVariable on field does not work in Quarkus

XMLWordPrintable

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

      If you put a @ShadowVariable annotation on a field (instead of a getter) and run it with quarkus, OptaPlanner-quarkus throws a IllegalStateException. None of the other annotations (@PlanningVariable, @PlanningPin, @InverseRelationShadowVariable, etc) suffer from this problem, nor does @PlanningVariable itself.

      Solution suggestion A

      Custom shadow variables need to access the source variable too. If the annotation is on a field, then the source variable should be regarded as a field too. If the @ShadowVariable annotation is on a getter, then the source variable should be regarded as a getter.

      If the source variable is regarded as a field, gizmo can generate a virtual getter, like it does for planning variables and the destination shadow variable already.

              cchianel Christopher Chianelli (Inactive)
              gds.geoffrey.de.smet@gmail.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: