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

java.lang.IllegalArgumentException when using kotlin data classes as PlanningEntity having a PlanningVariable with valueRangeProviderRefs to a collection of kotlin data classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.33.0.Final
    • 7.32.0.Final
    • optaplanner-core
    • None
    • NEW
    • NEW

      I am getting following error when using kotlin data classes as PlanningEntity having a PlanningVariable with valueRangeProviderRefs to a collection of kotlin data classes. Following is the stacktrace of the error. I was able to reproduce this issue on master branch of optaplanner.

      java.lang.IllegalArgumentException: The entityClass (class org.divy.resource.planning.domain.allocation.IterationAllocation) has a PlanningVariable annotated property (employee) that refers to a ValueRangeProvider annotated member (field private java.util.List org.divy.resource.planning.domain.iteration.IterationAllocations.employeeList) that returns a parameterized Collection with an unsupported type arguments (? extends org.divy.resource.planning.domain.employee.Employee).

        at org.optaplanner.core.impl.domain.valuerange.descriptor.AbstractFromPropertyValueRangeDescriptor.processValueRangeProviderAnnotation(AbstractFromPropertyValueRangeDescriptor.java:117)
        at org.optaplanner.core.impl.domain.valuerange.descriptor.AbstractFromPropertyValueRangeDescriptor.<init>(AbstractFromPropertyValueRangeDescriptor.java:57)
        at org.optaplanner.core.impl.domain.valuerange.descriptor.FromSolutionPropertyValueRangeDescriptor.<init>(FromSolutionPropertyValueRangeDescriptor.java:34)
        at org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor.buildValueRangeDescriptor(GenuineVariableDescriptor.java:152)
        at org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor.processValueRangeRefs(GenuineVariableDescriptor.java:139)
        at org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor.processPropertyAnnotations(GenuineVariableDescriptor.java:84)
        at org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor.processAnnotations(GenuineVariableDescriptor.java:77)
      

            Unassigned Unassigned
            divyakumarjain Divyakumar Jain (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: