From af5338f26e04a980f9dc762a3ebdad1cef9b8e87 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 16 Jun 2015 17:26:26 -0700 Subject: [PATCH] Formatting --- .../boot/actuate/cache/EhCacheStatisticsProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/EhCacheStatisticsProvider.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/EhCacheStatisticsProvider.java index 6d4ea92afb..45578677ec 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/EhCacheStatisticsProvider.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/EhCacheStatisticsProvider.java @@ -37,8 +37,9 @@ public class EhCacheStatisticsProvider implements CacheStatisticsProvider 1 ? 1 : hitRatio; + // ratio is calculated 'racily' and can drift marginally above unity, + // so we cap it here + double sanitizedHitRatio = (hitRatio > 1 ? 1 : hitRatio); statistics.setHitRatio(sanitizedHitRatio); statistics.setMissRatio(1 - sanitizedHitRatio); }