bug in EventBuilder method setParam()

Description

I'm creating some Drools rules for some extended event translation. For that reason I wanted to use the EventBuilder class to set some existing event parameters of an event to a new value. I tried to use the setParam() method of EventBuilder and saw, that an existing event parameter did not get a new value, instead, a new event parameter with the same name was added.

After a look into the source code:

public EventBuilder setParam(final String parmName, final String val) { if (m_event.getParmCollection().size() < 1) { return addParam(parmName, val); } for(final Parm parm : m_event.getParmCollection()) { if (parm.getParmName().equals(val)) { final Value value = new Value(); value.setContent(val); parm.setValue(value); return this; } }

I think, the condition in the second if() sould be

parm.getParmName().equals(parmName)

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Seth Leger July 1, 2015 at 11:46 AM

I checked this fix into develop for inclusion in 17. Marking as fixed. Thanks Michael!

commit 4c6a4b3f2ec42c6c3865239c0a40f34a216fdfc0

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created June 11, 2015 at 11:13 AM
Updated July 1, 2015 at 3:04 PM
Resolved July 1, 2015 at 11:46 AM

Flag notifications