keith-turner commented on code in PR #3788:
URL: https://github.com/apache/accumulo/pull/3788#discussion_r1340742061
##########
core/src/main/java/org/apache/accumulo/core/lock/ServiceLockData.java:
##########
@@ -164,30 +165,22 @@ public ServiceLockData(UUID uuid, String address,
ThriftService service) {
public String getAddressString(ThriftService service) {
ServiceDescriptor sd = services.get(service);
- if (sd == null) {
- return null;
- }
- return sd.getAddress();
+ return sd == null ? null : sd.getAddress();
}
public HostAndPort getAddress(ThriftService service) {
- return AddressUtil.parseAddress(getAddressString(service), false);
+ String s = getAddressString(service);
+ return s == null ? null : AddressUtil.parseAddress(s, false);
Review Comment:
Leveraging the existing optional and replacing if stmts with Optional.map
stmts was a really nice change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]