jSparrow v3.5.0/v2.2.0

Released: May 16, 2019

Mises à jour de v3.5.0/v2.2.0

Fonctionnalités

  • New Rule - Replace Map::get with Map::getOrDefault
    • Automatically replaces invocations of Map::get with the alternative Map::getOrDefault , thus eliminating the succeeding null checks.
    • Makes the code more readable, by using Java 8 extensions of Map interface.

Java 8 introduced Map::getOrDefault which offers the possibility to return a default value if the map does not contain a mapping for the given key. This rule replaces the invocations of Map::get followed by a null-check with Map::getOrDefault.