[jboss-jira] [JBoss JIRA] (DROOLS-2182) NPE when @Expires is missing on event type

Christian Bauer (JIRA) issues at jboss.org
Fri Dec 15 11:06:00 EST 2017


Christian Bauer created DROOLS-2182:
---------------------------------------

             Summary: 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: Edson Tirelli


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}




--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list