From 2fbc94bb87eaf86b4b0f0f1a540aafa5b18e882d Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Tue, 31 Dec 2019 10:50:09 +0100 Subject: [PATCH] set spotbugs ICAST_IDIV_CAST_TO_DOUBLE to ignore, because precision loss is intended --- core/src/main/java/hudson/Util.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index fe4334438e..7775b4ca6a 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -23,6 +23,7 @@ */ package hudson; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.model.TaskListener; import jenkins.util.MemoryReductionUtil; import hudson.util.QuotedStringTokenizer; @@ -692,6 +693,7 @@ public class Util { * number of milliseconds. */ @Nonnull + @SuppressFBWarnings(value = "ICAST_IDIV_CAST_TO_DOUBLE", justification = "We want to truncate here.") public static String getTimeSpanString(long duration) { // Break the duration up in to units. long years = duration / ONE_YEAR_MS;