Redundant null check in org.activiti.engine.impl.persistence.entity.JobEntity

Description

On 13Jan2104 a change was made to org.activiti.engine.impl.persistence.entity.JobEntity.java on line 99 that added a null check for the variable execution; after the change the line is:

if (execution != null && execution.getTenantId() != null) {

If one is looks 3 lines above in the code there is this line:

execution.addJob(this);

This null check is not needed as if the variable execution was null the method call for addJob(this) would fail first.

I believe the line should be simply:
if (execution.getTenantId() != null) {

I'm attaching a patch file.

Environment

None

Assignee

Joram Barrez

Reporter

David Malkovsky

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure