Where possible, java.time.Duration fields should be strongly typed rather than
stored as integral primitives and converted at the usage site.
For example, rather than:
public class X {
private static final long TIMEOUT = 100;
// later in the file
use(Duration.ofMillis(TIMEOUT));
}
Prefer:
public class X {
private static final Duration TIMEOUT = Duration.ofMillis(100);
// later in the file
use(TIMEOUT);
}
Suppress false positives by adding the suppression annotation @SuppressWarnings("StronglyTypeTime") to the enclosing element.