zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration on zookeeper-server
Date Sun, 11 Aug 2019 18:37:48 GMT
enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration
on zookeeper-server
URL: https://github.com/apache/zookeeper/pull/1049#discussion_r312748348
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java
 ##########
 @@ -279,75 +271,111 @@ public ZKClientConfig getClientConfig() {
 
         protected volatile Watcher defaultWatcher;
 
-        final private void addTo(Set<Watcher> from, Set<Watcher> to) {
+        private void addTo(Set<Watcher> from, Set<Watcher> to) {
             if (from != null) {
                 to.addAll(from);
             }
         }
 
-        public Map<EventType, Set<Watcher>> removeWatcher(String clientPath,
-                Watcher watcher, WatcherType watcherType, boolean local, int rc)
-                throws KeeperException {
+        public Map<EventType, Set<Watcher>> removeWatcher(
+                String clientPath,
+                Watcher watcher,
+                WatcherType watcherType,
+                boolean local,
+                int rc
+        ) throws KeeperException {
             // Validate the provided znode path contains the given watcher of
             // watcherType
             containsWatcher(clientPath, watcher, watcherType);
 
-            Map<EventType, Set<Watcher>> removedWatchers = new HashMap<EventType,
Set<Watcher>>();
-            HashSet<Watcher> childWatchersToRem = new HashSet<Watcher>();
-            removedWatchers
-                    .put(EventType.ChildWatchRemoved, childWatchersToRem);
-            HashSet<Watcher> dataWatchersToRem = new HashSet<Watcher>();
+            Map<EventType, Set<Watcher>> removedWatchers = new HashMap<>();
+            HashSet<Watcher> childWatchersToRem = new HashSet<>();
+            removedWatchers.put(EventType.ChildWatchRemoved, childWatchersToRem);
+            HashSet<Watcher> dataWatchersToRem = new HashSet<>();
 
 Review comment:
   Do these need to be `HashSet` or can they be `Set`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message