[jboss-jira] [JBoss JIRA] (DROOLS-1276) KieContainer.newKieSession((String) null) should return the default ksession to be consistent with getKieSessionModel(null)
Geoffrey De Smet (JIRA)
issues at jboss.org
Fri Sep 9 09:48:01 EDT 2016
[ https://issues.jboss.org/browse/DROOLS-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Geoffrey De Smet updated DROOLS-1276:
-------------------------------------
Priority: Critical (was: Major)
> KieContainer.newKieSession((String) null) should return the default ksession to be consistent with getKieSessionModel(null)
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-1276
> URL: https://issues.jboss.org/browse/DROOLS-1276
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Affects Versions: 6.5.0.CR1
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
> Priority: Critical
>
> This works to get the default kieSession:
> {code}
> String ksessionName = null;
> // if ksessionName is null, then the default kieSession is used
> KieSessionModel kieSessionModel = kieContainer.getKieSessionModel(ksessionName);
> {code}
> But this doesn't work to get the default ksession:
> {code}
> String ksessionName = null;
> // Fails if ksessionName is null. Should return the default ksession instead.
> return kieContainer.newKieSession(ksessionName);
> {code}
> The above fails if ksessioName is null with this stacktrace:
> {code}
> java.lang.NullPointerException
> at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
> at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:692)
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:652)
> at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirectorFactory.newKieSession(DroolsScoreDirectorFactory.java:129)
> {code}
> If no default ksession exists with argument null, a nice error message should be thrown.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list