summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorRobert Antoni Buj i Gelonch <robert.buj@gmail.com>2014-10-16 18:58:13 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-10-25 12:07:22 +0000
commite61c4b5f06241dd248cfe28b29cb658ea47bd72e (patch)
tree04aeef2097ccaeb16642b209e8d3c5c48c0161eb /connectivity
parentf824b1b575dbdb2bc515656a66cbb94764031a44 (diff)
java: prevent overflow by using 'long int' arithmetic in multiplication
Change-Id: I8dda8f4621f265208c713c9edcfe725f1c9c5998 Reviewed-on: https://gerrit.libreoffice.org/12001 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java b/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
index 57ce3f95372e..ecca4fd9868e 100644
--- a/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
+++ b/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
@@ -335,7 +335,7 @@ public class TestCacheSize {
System.out.println("Total insert: " + i);
System.out.println("Insert time: " + sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
}
private void fillUpMultiTable(String filler,
@@ -388,7 +388,7 @@ public class TestCacheSize {
System.out.println("Multi Key Total insert: " + i);
System.out.println("Insert time: " + sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
}
public void tearDown() {}
@@ -478,7 +478,7 @@ public class TestCacheSize {
|| (slow && (i + 1) % 100 == 0)) {
System.out.println("Select " + (i + 1) + " : "
+ sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
}
}
} catch (SQLException e) {
@@ -487,7 +487,7 @@ public class TestCacheSize {
System.out.println("Select random zip " + i + " rows : "
+ sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
sw.zero();
try {
@@ -511,7 +511,7 @@ public class TestCacheSize {
System.out.println("Select random id " + i + " rows : "
+ sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
sw.zero();
try {
@@ -535,7 +535,7 @@ public class TestCacheSize {
System.out.println("Select random zip from zip table " + i
+ " rows : " + sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
}
private void checkUpdates() {
@@ -570,7 +570,7 @@ public class TestCacheSize {
System.out.println("Update with random zip " + i
+ " UPDATE commands, " + count + " rows : "
+ sw.elapsedTime() + " rps: "
- + (count * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * count / (sw.elapsedTime() + 1)));
sw.zero();
try {
@@ -588,7 +588,7 @@ public class TestCacheSize {
|| (slow && (i + 1) % 100 == 0)) {
System.out.println("Update " + (i + 1) + " : "
+ sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
}
}
} catch (SQLException e) {
@@ -597,6 +597,6 @@ public class TestCacheSize {
System.out.println("Update with random id " + i + " rows : "
+ sw.elapsedTime() + " rps: "
- + (i * 1000 / (sw.elapsedTime() + 1)));
+ + (1000L * i / (sw.elapsedTime() + 1)));
}
}