stefan-egli commented on code in PR #7:
URL: 
https://github.com/apache/sling-org-apache-sling-discovery-base/pull/7#discussion_r924418572


##########
src/main/java/org/apache/sling/discovery/base/connectors/ping/TopologyConnectorServlet.java:
##########
@@ -249,67 +244,61 @@ protected void doPut(HttpServletRequest request, 
HttpServletResponse response)
                 return;
             } else if (ClusterViewHelper.contains(clusterView, 
incomingTopologyAnnouncement
                     .getOwnerId())) {
-               if (logger.isDebugEnabled()) {
-                       logger.debug("doPost: rejecting an announcement from an 
instance that is part of my cluster: "
-                               + incomingTopologyAnnouncement);
-               }
+                if (logger.isDebugEnabled()) {
+                    logger.debug("doPost: rejecting an announcement from an 
instance that is part of my cluster: "
+                            + incomingTopologyAnnouncement);
+                }
                 // marking as 'loop'
                 replyAnnouncement.setLoop(true);
                 backoffInterval = config.getBackoffStandbyInterval();
             } else if (ClusterViewHelper.containsAny(clusterView, 
incomingTopologyAnnouncement
                     .listInstances())) {
-               if (logger.isDebugEnabled()) {
-                       logger.debug("doPost: rejecting an announcement as it 
contains instance(s) that is/are part of my cluster: "
-                               + incomingTopologyAnnouncement);
-               }
+                if (logger.isDebugEnabled()) {
+                    logger.debug("doPost: rejecting an announcement as it 
contains instance(s) that is/are part of my cluster: "
+                            + incomingTopologyAnnouncement);
+                }
                 // marking as 'loop'
                 replyAnnouncement.setLoop(true);
                 backoffInterval = config.getBackoffStandbyInterval();
             } else {
                 backoffInterval = announcementRegistry
                         .registerAnnouncement(incomingTopologyAnnouncement);
                 if (logger.isDebugEnabled()) {
-                    logger.debug("doPost: backoffInterval after registration: 
"+backoffInterval);
+                    logger.debug("doPost: backoffInterval after registration: 
" + backoffInterval);
                 }
-                if (backoffInterval==-1) {
-                       if (logger.isDebugEnabled()) {
-                       logger.debug("doPost: rejecting an announcement from an 
instance that I already see in my topology: "
-                               + incomingTopologyAnnouncement);
-                       }
+                if (backoffInterval == -1) {
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("doPost: rejecting an announcement from 
an instance that I already see in my topology: "
+                                + incomingTopologyAnnouncement);
+                    }
                     // marking as 'loop'
                     replyAnnouncement.setLoop(true);
                     backoffInterval = config.getBackoffStandbyInterval();
                 } else {
                     // normal, successful case: replying with the part of the 
topology which this instance sees
                     replyAnnouncement.setLocalCluster(clusterView);
                     announcementRegistry.addAllExcept(replyAnnouncement, 
clusterView,
-                            new AnnouncementFilter() {
-    
-                                public boolean accept(final String 
receivingSlingId, Announcement announcement) {
-                                    if (announcement.getPrimaryKey().equals(
-                                            incomingTopologyAnnouncement
-                                                    .getPrimaryKey())) {
-                                        return false;
-                                    }
-                                    return true;
+                            (receivingSlingId, announcement) -> {
+                                if (announcement.getPrimaryKey().equals(
+                                        
incomingTopologyAnnouncement.getPrimaryKey())) {
+                                    return false;
                                 }
+                                return true;
                             });
                 }
             }
-            if (backoffInterval>0) {
+            if (backoffInterval > 0) {
                 replyAnnouncement.setBackoffInterval(backoffInterval);
-                if (logger.isDebugEnabled()) {
-                    logger.debug("doPost: backoffInterval for client set to 
"+replyAnnouncement.getBackoffInterval());
-                }
+                logger.debug("doPost: backoffInterval for client set to " + 
replyAnnouncement.getBackoffInterval());

Review Comment:
   same thing with `isDebugenabled()` here, very minor though, wdyt? 
   
   ```suggestion
                   if (logger.isDebugEnabled()) {
                       logger.debug("doPost: backoffInterval for client set to 
" + replyAnnouncement.getBackoffInterval());
                   }
   ```



-- 
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]

Reply via email to