Github user edwardoliveira commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/150#discussion_r98483994
  
    --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
    @@ -122,18 +122,19 @@ public int size() {
         private int nextAdded = 0;
         private int nextRemoved = 0;
     
    -    public int getNextAdded() {
    +    int getNextAdded() {
             return nextAdded;
         }
     
    -    public int getNextRemoved() {
    +    int getNextRemoved() {
             return nextRemoved;
         }
     
         public InetSocketAddress next(long spinDelay) {
             // Handle possible connection error by re-resolving hostname if 
possible
             if (!connectedSinceNext) {
                 InetSocketAddress curAddr = serverAddresses.get(currentIndex);
    +            String curHostString = getHostString(curAddr);
                 if 
(!getHostString(curAddr).equals(curAddr.getAddress().getHostAddress())) {
    --- End diff --
    
    @fpj Sorry for yet another comment, mate (my last one, I promise). I cited 
this previously but certainly got lost in my verbosite. 
    
    * Replace `if (!getHostString(currAddr).equals(...)) {` by 'if 
(!curHostString.equals()` at Line 138;
    
    * Replace `getHostString(curAddr)` with `curHostString` at line 139;
    
    * Replace `getHostString(curAddr)` with `curHostString` at line 142;
    
    **+1. LGTM. Really great job!.**
    
    Best regards,



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to