Hide Forgot
Date of First Response: 2009-10-04 05:46:53 securitylevel_name: Public StatefulKnowledgeSession.getObjects() returns a collection containing the objects in working memory. The Javadoc for Collection.contains says: "Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)). " This is not the case though for StatefulKnowledgeSessionImpl.ObjectStoreWrapper. The implementation of contains returns true only if it is the exact same object instance, but false if it is a different instance but which equals the instance in the working memory. A workaround is to create a new collection and put the items returned into that.
Link: Added: This issue is related to JBRULES-2057
Fix in place.
added to the 5.0.CP01 release notes as resolved: JBRULES-2057 StatefulKnowledgeSession.getObjects() returns a Collection whose contains method that does not conform to the expected Java Collection behaviour. This is intentional and has now been documented in the API JavaDocs.