Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.5.0
-
None
Description
@Override public CompositeData[] browse(int page, int pageSize) throws Exception { String filter = null; checkStarted(); clearIO(); try { long index = 0; CID 1464349 (#1 of 2): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) [select issue] long start = (page - 1) * pageSize; CID 1464349 (#2 of 2): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)overflow_before_widen: Potentially overflowing expression page * pageSize with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type long (64 bits, signed). To avoid overflow, cast either page or pageSize to type long rather than casting the result of the potential overflow. long end = Math.min((long)(page * pageSize), queue.getMessageCount());
Attachments
Issue Links
- is part of
-
ARTEMIS-1400 FindBugs warnings
- Closed