apache / incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
http://www.drools.org
Apache License 2.0
5.88k stars 2.5k forks source link

[kie-issues#1154] Make KieSession auto-closeable #5890

Closed baldimir closed 6 months ago

baldimir commented 6 months ago

Fixes: https://github.com/apache/incubator-kie-issues/issues/1154

Makes KieSession implement the AutoCloseable interface, so it can be used in try-with-resources code blocks. No new tests added, because KieSession does not have any listener for dispose events. Therefore, some tests were changed to use try-with-resources to dispose the KieSession.

baldimir commented 6 months ago

Jenkins failure is not related to my changes, it is caused by environment.