jSparrow v3.5.0/v2.2.0

Ajout d'une nouvelle règle Map::getOrDefault pour améliorer la visibilité du code en utilisant les extensions Java 8 de l’interface Map.
Mai 17, 2019
Nouvelle Version

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.

jSparrow - Replace Map::get by Map::getOrDefault

jSparrow

Refactorisation automatique de Java.

Vous avez une question ?

Discutez en direct avec l'un de nos spécialiste des licences jSparrow .