JavaDurationWithSeconds
Use of java.time.Duration.withSeconds(long) is not allowed.

Severity
WARNING

The problem

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

Suppression

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