Repository: square/leakcanary
Issue: Crash in LongLongScatterMap

### Description

Crash:

```
Caused by: java.lang.ArithmeticException: divide by zero
        at java.util.Formatter$FormatSpecifier.localizedMagnitude(Formatter.java:4210)
        at java.util.Formatter$FormatSpecifier.print(Formatter.java:3140)
        at java.util.Formatter$FormatSpecifier.print(Formatter.java:3121)
        at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2826)
        at java.util.Formatter$FormatSpecifier.print(Formatter.java:2786)
        at java.util.Formatter.format(Formatter.java:2491)
        at java.util.Formatter.format(Formatter.java:2426)
        at java.lang.String.format(String.java:2670)
        at shark.internal.hppc.LongLongScatterMap.allocateBuffers(LongLongScatterMap.kt:330)
        at shark.internal.hppc.LongLongScatterMap.allocateThenInsertThenRehash(LongLongScatterMap.kt:361)
        at shark.internal.hppc.LongLongScatterMap.set(LongLongScatterMap.kt:106)
        at shark.internal.DominatorTree.updateDominated(DominatorTree.kt:51)
        at shark.internal.PathFinder$VisitTracker$Dominated.visited(PathFinder.kt:94)
        at shark.internal.PathFinder.enqueue(PathFinder.kt:630)
        at shark.internal.PathFinder.visitInstance(PathFinder.kt:502)
        at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:277)
        at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:225)
        at shark.HeapAnalyzer.findLeaks(HeapAnalyzer.kt:197)
        at shark.HeapAnalyzer.analyzeGraph(HeapAnalyzer.kt:175)
        at shark.HeapAnalyzer.analyze(HeapAnalyzer.kt:101)
        at shark.HeapAnalyzer.analyze$default(HeapAnalyzer.kt:81)
 ```
 
Looks like this is a bug related to using non US locale and using `%,d` (ie the comma)

 https://stackoverflow.com/questions/55656107/weird-crashes-java-lang-arithmeticexception-divide-by-zero

Changed files:
shark-graph/src/main/java/shark/internal/hppc/LongObjectScatterMap.kt, shark-graph/src/main/java/shark/internal/hppc/LongScatterSet.kt, shark-graph/src/main/java/shark/internal/hppc/LongLongScatterMap.kt

diff --git a/shark-graph/src/main/java/shark/internal/hppc/LongLongScatterMap.kt b/shark-graph/src/main/java/shark/internal/hppc/LongLongScatterMap.kt
index 1fc1220ae..1da1ece06 100644
--- a/shark-graph/src/main/java/shark/internal/hppc/LongLongScatterMap.kt
+++ b/shark-graph/src/main/java/shark/internal/hppc/LongLongScatterMap.kt
@@ -326,7 +326,7 @@ internal class LongLongScatterMap constructor(expectedElements: Int = 4) {
       throw RuntimeException(
         String.format(
           Locale.ROOT,
-          "Not enough memory to allocate buffers for rehashing: %,d -> %,d",
+          "Not enough memory to allocate buffers for rehashing: %d -> %d",
           this.mask + 1,
           arraySize
         ), e
diff --git a/shark-graph/src/main/java/shark/internal/hppc/LongObjectScatterMap.kt b/shark-graph/src/main/java/shark/internal/hppc/LongObjectScatterMap.kt
index 8dd99e792..5f7ba0d61 100644
--- a/shark-graph/src/main/java/shark/internal/hppc/LongObjectScatterMap.kt
+++ b/shark-graph/src/main/java/shark/internal/hppc/LongObjectScatterMap.kt
@@ -275,7 +275,7 @@ internal class LongObjectScatterMap<T> {
       throw RuntimeException(
         String.format(
           Locale.ROOT,
-          "Not enough memory to allocate buffers for rehashing: %,d -> %,d",
+          "Not enough memory to allocate buffers for rehashing: %d -> %d",
           this.mask + 1,
           arraySize
         ), e
diff --git a/shark-graph/src/main/java/shark/internal/hppc/LongScatterSet.kt b/shark-graph/src/main/java/shark/internal/hppc/LongScatterSet.kt
index b8ec45c07..abdc18bd1 100644
--- a/shark-graph/src/main/java/shark/internal/hppc/LongScatterSet.kt
+++ b/shark-graph/src/main/java/shark/internal/hppc/LongScatterSet.kt
@@ -224,7 +224,7 @@ internal class LongScatterSet(expectedElements: Int = 4) {
       throw RuntimeException(
         String.format(
           Locale.ROOT,
-          "Not enough memory to allocate buffers for rehashing: %,d -> %,d",
+          "Not enough memory to allocate buffers for rehashing: %d -> %d",
           size(),
           arraySize
         ), e
@@ -250,4 +250,4 @@ internal class LongScatterSet(expectedElements: Int = 4) {
     // Rehash old keys, including the pending key.
     rehash(prevKeys)
   }
-}
\\ No newline at end of file
+}