Suspicious equals() test in org.activiti.engine.impl.persistence.entity.DeploymentEntityManager

Description

In org.activiti.engine.impl.persistence.entity.DeploymentEntityManager there is a very suspicious equals() test around line 105 where both getId() and getKey() are being compared to the processDefinition:

if (!p.getId().equals(processDefinition) && p.getKey().equals(processDefinition)) {
nrOfProcessDefinitionsWithSameKey++;
}

This code was introduced with http://jira.codehaus.org/browse/ACT-1533

I suspect the code needs a method call on the right hand processDefinition instance for both conditions; something like:
if (!p.getId().equals(processDefinition.getId()) && p.getKey().equals(processDefinition.getKey())) {
nrOfProcessDefinitionsWithSameKey++;
}

If so, then I've attached the patch to make that change.

Environment

None

Assignee

Tijs Rademakers

Reporter

David Malkovsky

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure