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

ArithmeticException: / by zero in DefaultSubChainSelector

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.21.0.Final
    • None
    • optaplanner-core
    • None
    • 2018 Week 45-47, 2018 Week 48-50, 2019 Week 02-04, 2018 Week 51-01
    • 1
    • NEW
    • NEW

      > Caused by: java.lang.ArithmeticException: / by zero
      > at org.optaplanner.core.impl.heuristic.selector.value.chained.DefaultSubChainSelector.constructCache (DefaultSubChainSelector.java:139)

      That DefaultSubChainSelector builds a List<SubChain> anchorTrailingChainList to cache some info,
      to answer faster when having to select the next subchain.

      When doing that, it presumes the anchorList.size() != 0, when giving a good capacity estimate.
      That's clearly a bug.

      int anchorChainInitialCapacity = ((int) valueSize / anchorList.size()) + 1;

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

              Created:
              Updated:
              Resolved: