Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1872

Overloading of the Math.abs method mvel regression

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.12.1.GA
    • 7.12.1.GA
    • OptaPlanner

      type casting exception in OptaPlanner 7.x tests which uses drl
      Caused by: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Double (java.lang.Integer and java.lang.Double are in module java.base of loader 'bootstrap')
      The rule is:

      rule "periodSpread"
          when
              $constraintConfiguration : ExaminationConstraintConfiguration()
              $topicConflict : TopicConflict($leftTopic : leftTopic, $rightTopic : rightTopic)
              $leftExam : Exam(topic == $leftTopic, $leftPeriodIndex : periodIndex, period != null)
              $rightExam : Exam(topic == $rightTopic, period != null,
                      Math.abs($leftPeriodIndex - periodIndex) < ($constraintConfiguration.getPeriodSpreadLength() + 1))
          then
              scoreHolder.penalize(kcontext, $topicConflict.getStudentSize());
      end
      

      The problematic string is here : Math.abs($leftPeriodIndex - periodIndex) < ($constraintConfiguration.getPeriodSpreadLength() + 1))

      Problem fixed on mvel
      https://github.com/mvel/mvel/commit/33405a17ae203d91c29e87da0e89c117f566d7ce

      Hotfix for OptaPlanner
      https://github.com/kiegroup/optaplanner/pull/1756

      PR: https://github.com/kiegroup/optaplanner/commit/14b0af321c2f05992e36a56aaa5c7455e24e6856

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

                Created:
                Updated:
                Resolved: