Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-5908

NPE in IntervalTrigger when timestamp + delay > endTime

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 7.47.0.Final
    • core engine
    • None
    • 2020 Week 52-03 (from Dec 21)
    • Hide

      Use the following code snippet:
       

              long now = Instant.now().toEpochMilli();
              long delay = 10;
              Date endTime = new Date(now + delay - 1);
              new IntervalTrigger(Instant.now().toEpochMilli(), null, endTime, -1, delay, 10000, null, new CalendarsImpl(), null, null);
      

       

      Show
      Use the following code snippet:   long now = Instant.now().toEpochMilli(); long delay = 10; Date endTime = new Date(now + delay - 1); new IntervalTrigger(Instant.now().toEpochMilli(), null , endTime, -1, delay, 10000, null , new CalendarsImpl(), null , null );  
    • Undefined
    • NEW
    • NEW
    • ---
    • ---

      If using timer(expr: $d, $p; end=$e) with $e > now + $d

      We have the following stack trace:

      Exception in thread "Thread-1" java.lang.NullPointerException: Cannot invoke "java.util.Date.getTime()" because "this.nextFireTime" is null at org.drools.core.time.impl.IntervalTrigger.getTimeAfter(IntervalTrigger.java:224)
      

      It should probably just not fire anything in that situation.

              mfusco@redhat.com Mario Fusco
              thomas.huriaux Thomas Huriaux (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: