JavaDurationWithNanos
Use of java.time.Duration.withNanos(int) is not allowed.

Severity
WARNING

The problem

Duration’s withNanos(int) method is often a source of bugs because it returns a copy of the current Duration instance, but only the nano field is mutated (the seconds field is copied directly). Use Duration.ofSeconds(duration.getSeconds(), nanos) instead.

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("JavaDurationWithNanos") to the enclosing element.