You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/03/28 17:34:27 UTC

[GitHub] [commons-jcs] tvand commented on a change in pull request #35: JCS-211 - Use Map.forEach()

tvand commented on a change in pull request #35:
URL: https://github.com/apache/commons-jcs/pull/35#discussion_r602907343



##########
File path: commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/CacheWatchRepairable.java
##########
@@ -58,22 +58,16 @@
     public void setCacheWatch( final ICacheObserver cacheWatch )
     {
         this.cacheWatch = cacheWatch;
-        cacheMap.entrySet().forEach(entry -> {
-            final String cacheName = entry.getKey();
-            entry.getValue().forEach(listener -> {
-                try
-                {
-                    log.info( "Adding listener to cache watch. ICacheListener = "
-                            + "{0} | ICacheObserver = {1}", listener, cacheWatch );
-                    cacheWatch.addCacheListener( cacheName, listener );
-                }
-                catch ( final IOException ex )
-                {
-                    log.error( "Problem adding listener. ICacheListener = {0} | "
-                            + "ICacheObserver = {1}", listener, cacheWatch, ex );
-                }
-            });
-        });
+        cacheMap.forEach((cacheName, value) -> value.forEach(listener -> {

Review comment:
       Please use the code formatting conventions of the project.




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