]
Mario Fusco updated DROOLS-2182:
--------------------------------
Sprint: 2018 Week 01-02
NPE when @Expires is missing on event type
------------------------------------------
Key: DROOLS-2182
URL:
https://issues.jboss.org/browse/DROOLS-2182
Project: Drools
Issue Type: Bug
Affects Versions: 7.5.0.Final
Reporter: Christian Bauer
Assignee: Mario Fusco
This code in {{ClassObjectTypeConf}} assumes that an event class always has an @Expires
annotation, which is optional:
{code}
Role role = clazz.getAnnotation(Role.class);
if (role != null) {
isEvent = role.value() == Type.EVENT;
if (isEvent) {
Expires expires = clazz.getAnnotation(Expires.class);
expirationOffset = TimeIntervalParser.parseSingle( expires.value()
);
}
}
{code}
{code}
java.lang.NullPointerException
at org.drools.core.reteoo.ClassObjectTypeConf.<init>(ClassObjectTypeConf.java:99)
at
org.drools.core.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:69)
at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:181)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:1493)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:1453)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:1447)
{code}