Matteo Casalino created DROOLS-5687:
---------------------------------------
Summary: 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
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}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)