Fix AccountLimitsConfig error prone error
The following error was fixed:
error: [ImpossibleNullComparison] This value cannot be null, and comparing it to null may be misleading.
return Optional.ofNullable(rateLimits.row(type));
^
Change-Id: Iffc891f138b70bbfc38c004f1081476e4c7569ec
diff --git a/src/main/java/com/googlesource/gerrit/plugins/quota/AccountLimitsConfig.java b/src/main/java/com/googlesource/gerrit/plugins/quota/AccountLimitsConfig.java index 9c94fae..504dd2f 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/quota/AccountLimitsConfig.java +++ b/src/main/java/com/googlesource/gerrit/plugins/quota/AccountLimitsConfig.java
@@ -188,9 +188,6 @@ * @return map of rate limits per group name */ Optional<Map<String, RateLimit>> getRatelimits(Type type) { - if (rateLimits != null) { - return Optional.ofNullable(rateLimits.row(type)); - } - return Optional.empty(); + return Optional.ofNullable(rateLimits).map(limits -> limits.row(type)); } }