[jboss-jira] [JBoss JIRA] (DROOLS-5522) Fix InternalKieModule.createKieModule
Mario Fusco (Jira)
issues at jboss.org
Wed Jul 22 11:14:24 EDT 2020
[ https://issues.redhat.com/browse/DROOLS-5522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco updated DROOLS-5522:
--------------------------------
Sprint: 2020 Week 28-30 (from Jul 6)
> Fix InternalKieModule.createKieModule
> -------------------------------------
>
> Key: DROOLS-5522
> URL: https://issues.redhat.com/browse/DROOLS-5522
> Project: Drools
> Issue Type: Task
> Reporter: Gabriele Cardosi
> Assignee: Mario Fusco
> Priority: Major
>
> {code:java}
> org.drools.compiler.kie.builder.impl.InternalKieModule.createKieModule(ReleaseId releaseId, File jar)
> {code}
> has a couple of issues
> 1) there is not a check on the actual type of File received as parameter: it expects it to be a "jar" - but this is not checked anywhere - so
> {code:java}
> ZipFile zipFile = new ZipFile(jar)
> {code}
> throws an exception whenever the given file is not a "jar"
> 2) every exceptions are catch and simply logged; but it seems that whatever exception may happen inside this if
> {code:java}
> if (zipEntry != null) {
> KieModuleModel kieModuleModel = KieModuleModelImpl.fromXML( zipFile.getInputStream( zipEntry ) );
> setDefaultsforEmptyKieModule( kieModuleModel );
> return kieModuleModel != null ? InternalKieModuleProvider.get( adapt( releaseId ), kieModuleModel, jar ) : null;
> }
> {code}
> it is actually a grave exception, since it means that it was impossible to retrieve an expected KieModule out of a given "kjar" (we know it is a kjar because zipEntry != null)
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list