Unused assignment and possible integer overflow

Description

In org.activiti.engine.impl.AbstractNativeQuery, lines 130-134 are:

If the variable maxResults is equal to the maximum integer value, then the variable lastRow is set but then immediately overwritten by the next line of code.

Attached is a java test program, MaxValue.java, that shows the issue and the subsequent issues with possible integer overflows.

The suggested change is:

There is patch file attachment that implements this change.

This issue was introduced in commit ef36793d911cc903d618a876d1b81604305b3f15 on 16May2013.

Environment

None

Assignee

Tijs Rademakers

Reporter

David B Malkovsky

Labels

None

Components

Fix versions

Affects versions

Priority

Lowest
Configure