jSparrow v3.10.0/v2.7.0

New Optional.ifPresentOrElse rule improves readability and enables the use of higher order functions.
November 06, 2019 - 17:42
New Version

Features

New Rule - Use Optional::ifPresentOrElse (for Java 9 and above).

  • In Java 9, the Optional API has been extended with the Optional#ifPresentOrElse method. jSparrow replaces if-then-else statements, checking for Optional#isPresent , with a single invocation of Optional#ifPresentOrElse.
    This improves the readability of the code and enables the usage of higher order functions with Optional.
Optional::ifPresentOrElse rule in jSparrow.

jSparrow

Automatic Java Refactoring

Got a Question?

Live Chat with our jSparrow licensing specialists now.