flushInterval is limited to hours
---------------------------------
Key: IBATIS-467
URL: https://issues.apache.org/jira/browse/IBATIS-467
Project: iBatis for Java
Issue Type: Bug
Components: SQL Maps
Affects Versions: 2.3.0
Environment: windows
Reporter: odelya glick
Priority: Trivial
he problem is that the flush interval is computed in milliseconds, which can
easily overflow integer boundaries. The code used in parsing the flush interval:
long t = 0;
String hours = childAttributes.getProperty("hours");
if (hours != null) t += Integer.parseInt(hours) * 60 * 60 * 1000;
Although the long can hold this information, any arithmetic done in Java with
two integer operands results in an integer. The code should explicitly define
computation outcome:
long t = 0;
String hours = childAttributes.getProperty("hours");
if (hours != null) t += (long)Integer.parseInt(hours) * 60 * 60 * 1000;
The same modifications should probably be made for the other cases.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.