Skip to content

Commit 1ba0221

Browse files
Merge pull request thymeleaf#647 from yoshikawaa/issue646
Fix thymeleaf#646 - Fix calculation hit ratio in StandardCache's cache report.
2 parents 1933137 + b1d1dc7 commit 1ba0221

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/thymeleaf/cache/StandardCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public double getHitRatio() {
306306
return 0;
307307
}
308308

309-
return hitCount / getCount;
309+
return (double) hitCount / (double) getCount;
310310
}
311311

312312
public double getMissRatio() {
@@ -336,7 +336,7 @@ private void outputReportIfNeeded() {
336336
long putCount = getPutCount();
337337
long getCount = getGetCount();
338338

339-
double hitRatio = hitCount / getCount;
339+
double hitRatio = (double) hitCount / (double) getCount;
340340
double missRatio = 1 - hitRatio;
341341

342342
this.logger.trace(

0 commit comments

Comments
 (0)