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

Severity
ERROR
Has Fix?
REQUIRES_HUMAN_ATTENTION

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.