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

OptaPlanner discovers PlanningId twice if defined on a getter inside a non-public parent class.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 8.6.0.Final
    • optaplanner-quarkus
    • None
    • Undefined
    • NEW
    • NEW

      The issue is relevant only to domain discovery in optaplanner-quarkus.

      The following setup:

      // with a public class, detection works correctly
      abstract class AbstractIdentifiable {
      
          private Long id;
      
          @PlanningId
          public Long getId() {
              return id;
          }
      }
      
      public class TestdataEntity extends AbstractIdentifiable {
      ...
      }
      

      results in:
      "java.lang.IllegalArgumentException: The class (class org.optaplanner.quarkus.testdata.superclass.domain.TestdataEntity) has 2 members ([public java.lang.Long org.optaplanner.quarkus.testdata.superclass.domain.TestdataEntity.getId(), public java.lang.Long org.optaplanner.quarkus.testdata.superclass.domain.AbstractIdentifiable.getId()]) with a PlanningId annotation."

      suggesting there are two getters with the @PlanningId annotation, which is not the case.

              cchianel Christopher Chianelli (Inactive)
              rsynek@redhat.com Radovan Synek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: