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

Constraint collectors: LocalDateTime breaks max()

XMLWordPrintable

    • 2023 Week 03-05 (from Jan 16)
    • 2
    • NEW
    • NEW

      This works:

      Function<Job, Duration> f = (Job job) -> (Duration) job.getDuration();
      UniConstraintCollector<Job, ?, Duration> max = ConstraintCollectors.max(f);
      

      This doesn't compile:

      Function<Job, LocalDateTime> f = (Job job) -> (LocalDateTime) job.getEndDateTime();
      UniConstraintCollector<Job, ?, LocalDateTime> max = ConstraintCollectors.max(f);
      

      See:
      https://kie.zulipchat.com/#narrow/stream/232679-optaplanner/topic/Collectors.2Emax.28.29.20generics

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

                Created:
                Updated:
                Resolved: