jSparrow v3.5.0/v2.2.0

透過使用 Map 介面的 Java 8 擴展,添加新的 Map::getOrDefault 規則,使代碼更具可讀性。
5月 17, 2019
新版本

特性

  • 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

自動 Java 重構。

有任何疑問嗎?

Live Chat現在與我們的jSparrow 專家即時聊天詢問。