[jboss-jira] [JBoss JIRA] Created: (JBRULES-2788) NPE in AbstractWorkingMemory due to session.retract(null)

Wolfgang Laun (JIRA) jira-events at lists.jboss.org
Fri Nov 12 08:03:36 EST 2010


NPE in AbstractWorkingMemory due to session.retract(null)
---------------------------------------------------------

                 Key: JBRULES-2788
                 URL: https://jira.jboss.org/browse/JBRULES-2788
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core  (expert)
    Affects Versions: 5.1.1.FINAL
            Reporter: Wolfgang Laun
            Assignee: Mark Proctor
             Fix For: 5.2.0.M1


StatefulKnowledgeSession kSession = ...;
kSession.retract( null );

Notice that this might occur if kSession.getFactHandle() returns null because the fact object
is invalid or already gone etc.

The above call causes

 java.lang.NullPointerException
	at org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1261)
	at org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1242)
	at org.drools.impl.StatefulKnowledgeSessionImpl.retract(StatefulKnowledgeSessionImpl.java:255)
	at resource.Main.exec(Main.java:92)

Expected: This should be ignored, or throw an Exception with a reasonable diagnostic. (Javadoc does not say that an exception may be thrown.)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list