Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.3.0
-
None
Description
When using Map#putIfAbsent, the argument should not be a new object. Otherwise, if the item is present, the object that was instantiated is immediately thrown away. Instead, use Map#computeIfAbsent so that the object is only instantiated if it is needed.
There exists a good example in the Map JavaDoc:
Locations
Attachments
Attachments
Issue Links
- is depended upon by
-
HBASE-27250 MasterRpcService#setRegionStateInMeta does not support replica region encodedNames or region names
- Resolved
- links to