DurationFrom
Duration.from(Duration) returns itself; from(Period) throws a runtime exception.

Severity
ERROR

The problem

Duration.from(TemporalAmount) will always throw a UnsupportedTemporalTypeException when passed a Period and return itself when passed a Duration.

Suppression

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