]
Mario Fusco updated DROOLS-5687:
--------------------------------
Sprint: 2020 Week 40-42 (from Sep 28)
NullPointerException on second consecutive declared type update
---------------------------------------------------------------
Key: DROOLS-5687
URL:
https://issues.redhat.com/browse/DROOLS-5687
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.43.0.Final
Reporter: Matteo Casalino
Assignee: Mario Fusco
Priority: Major
Attachments: npe-consecutives-declare-update.zip
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):
{noformat}
declare FactType1
x : int
end
declare FactType2
y : int
end
{noformat}
first update:
{noformat}
declare FactType1
x : int
z : int
end
declare FactType2
y : int
end
{noformat}
second update:
{noformat}
declare FactType1
x : int
z : int
w : int
end
declare FactType2
y : int
end
{noformat}
The second update will raise the following exception:
{noformat}
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)
{noformat}