EntityEcaUtil.getEntityEcaRules has a generics bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

EntityEcaUtil.getEntityEcaRules has a generics bug

Adam Heath-2
org.ofbiz.entityext.eca.EntityEcaUtil.getEntityEcaRules() returns a
Collection.  If it finds the event that is being requested, then that
collection contains EntityEcaRule.

However, if eventMap is found, but the event is not, then it returns the
maps *values*, which is a Collection of Collections of EntityEcaRules.
This can not be correct.  Calling code would fall over in this case.

I'm leaning towards having it return null, as if the eventMap is not
found, this is what would already occur.