Show
Two reproducers are attached. reproducer_jitting_2a.zip is a reproducer similar to real-world example, and reproducer_jitting_2b.zip is a further simplified one of it.
reproducer_jitting_2a.zip
Extract reproducer.
$ unzip reproducer_jitting_2a.zip
$ cd reproducer_jitting_2a
Build and execute the rule.
$ ./run_mvn
:
:
***** start
***** rule_jitting_2a_2: TargetDate{date = 19500131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19510131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19520131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 19530131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19540131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19550131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19560131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 19570131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19580131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19590131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19600131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 19610131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19620131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19630131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19640131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 19650131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19660131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19670131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19680131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 19690131, leapYear = false}
15:11:23.349 [drools-worker-2] WARN org.drools.mvel.MVELConstraint - Exception jitting: ($year % 400) == 0 || (($year % 4) == 0 && ($year % 100) != 0) This is NOT an error and NOT prevent the correct execution since the constraint will be evaluated in intrepreted mode // ..... (*3-1)
15:11:23.349 [drools-worker-3] WARN org.drools.mvel.MVELConstraint - Exception jitting: ($year % 4) != 0 || (($year % 400) != 0 && ($year % 100) == 0) This is NOT an error and NOT prevent the correct execution since the constraint will be evaluated in intrepreted mode // ..... (*3-2)
***** rule_jitting_2a_2: TargetDate{date = 19700131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19710131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19720131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 19730131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19740131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19750131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19760131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 19770131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19780131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 19790131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 19800131, leapYear = true}
:
:
***** rule_jitting_2a_1: TargetDate{date = 20160131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 20170131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 20180131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 20190131, leapYear = false}
***** rule_jitting_2a_1: TargetDate{date = 20200131, leapYear = true}
***** rule_jitting_2a_2: TargetDate{date = 20210131, leapYear = false}
***** rule_jitting_2a_2: TargetDate{date = 20220131, leapYear = false}
***** end
:
:
This is a sample reproducer which determines whether the date is in a leap year. You can see that jitting failed by warning messages (*3-1) and (*3-2).
reproducer_jitting_2b.zip
Extract reproducer.
$ unzip reproducer_jitting_2b.zip
$ cd reproducer_jitting_2b
Build and execute the rule.
$ ./run_mvn
:
:
***** start
15:21:02.416 [main] WARN org.drools.mvel.MVELConstraint - Exception jitting: (value % 400) == 0 || ((value % 4) == 0 && (value % 100) != 0) This is NOT an error and NOT prevent the correct execution since the constraint will be evaluated in intrepreted mode // ..... (*4-1)
15:21:02.427 [main] WARN org.drools.mvel.MVELConstraint - Exception jitting: (value % 4) != 0 || ((value % 400) != 0 && (value % 100) == 0) This is NOT an error and NOT prevent the correct execution since the constraint will be evaluated in intrepreted mode // ..... (*4-2)
***** rule_jitting_2b_1: leap year, value = 2020
***** end
:
:
In this reproducer, -Ddrools.jittingThreshold=0 is specified in pom.xml .
You can see that jitting failed by warning messages (*4-1) and (*4-2).