ctubbsii commented on code in PR #3788:
URL: https://github.com/apache/accumulo/pull/3788#discussion_r1340744766
##########
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:
It wasn't strictly necessary to do that to fix the issue, but it made the
code so much easier to understand while I was trying to track down and verify
there were no negative side-effects by any of the existing callers when I
changed the behavior of this getAddress method.
--
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]