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

NullPointerException on second consecutive declared type update

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.43.0.Final
    • core engine
    • None
    • 2020 Week 40-42 (from Sep 28)
    • Hide

      Run:

      mvn clean test

      on attached reproducer.

      Show
      Run: mvn clean test on attached reproducer.
    • Undefined
    • NEW
    • NEW
    • ---
    • ---

      When updating a KieContainer with updateToVersion with a change in a declared type two consecutive times, a NullPointerException is raised.

      Minimal example DRL triggering the issue (notice at least two declared types are needed):

      declare  FactType1
          x : int
      end
      
      declare  FactType2
          y : int
      end
      

      first update:

      declare  FactType1
          x : int
          z : int
      end
      
      declare  FactType2
          y : int
      end
      

      second update:

      declare  FactType1
          x : int
          z : int
          w : int
      end
      
      declare  FactType2
          y : int
      end
      

      The second update will raise the following exception:

      java.lang.NullPointerException
      	at org.drools.compiler.kie.util.ChangeSetBuilder.build(ChangeSetBuilder.java:106)
      	at org.drools.compiler.kie.builder.impl.InternalKieModule.getChanges(InternalKieModule.java:132)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:241)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:237)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:195)
      	at org.example.reproducer.KjarUpdateTest.update(KjarUpdateTest.java:37)
      	at org.example.reproducer.KjarUpdateTest.testConsecutiveUpdates(KjarUpdateTest.java:48)
      

            mfusco@redhat.com Mario Fusco
            mcasalino Matteo Casalino (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: