You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jj...@apache.org on 2018/09/26 07:35:43 UTC
[geode] 01/01: Merge pull request #2506 from
jujoramos/feature/GEODE-5523
This is an automated email from the ASF dual-hosted git repository.
jjramos pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 8e3c5bb35b8de490fe69c7f18fba3c32cac69227
Merge: 39d225d 1cf6477
Author: Juan José Ramos <ju...@users.noreply.github.com>
AuthorDate: Wed Sep 26 08:35:32 2018 +0100
Merge pull request #2506 from jujoramos/feature/GEODE-5523
GEODE-5523: Remove DefaultHashMap
The internal class `DefaultHashMap` was designed as an internal
workaround to return a default value whenever the value returned by
`Map.get(K)` was `null`. Starting with Java 8 the `Map` interface
added the method `getOrDefault`, which does something similar in a more
efficient way but it returns the default only if the key doesn't exist.
After inspecting the code, we don't insert `null` values into the
`statsMap`, so it is safe to delete the old `DefaultHashMap` class and
replace its usage by `Map.getOrDefault`.
.../beans/stats/AggregateRegionStatsMonitor.java | 20 +++++-----
.../internal/beans/stats/GCStatsMonitor.java | 8 ++--
.../beans/stats/GatewaySenderOverflowMonitor.java | 13 ++++---
.../internal/beans/stats/MBeanStatsMonitor.java | 35 +++--------------
.../beans/stats/MemberLevelDiskMonitor.java | 30 +++++++--------
.../internal/beans/stats/VMStatsMonitor.java | 2 +-
.../stats/AggregateRegionStatsMonitorTest.java | 10 +++--
.../internal/beans/stats/GCStatsMonitorTest.java | 5 ++-
.../stats/GatewaySenderOverflowMonitorTest.java | 10 +++--
.../beans/stats/MBeanStatsMonitorTest.java | 44 +++++++++++-----------
.../beans/stats/MemberLevelDiskMonitorTest.java | 9 +++--
11 files changed, 90 insertions(+), 96 deletions(-)