You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by db...@apache.org on 2011/09/30 05:28:51 UTC

svn commit: r1177491 - /commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java

Author: dbrosius
Date: Fri Sep 30 03:28:51 2011
New Revision: 1177491

URL: http://svn.apache.org/viewvc?rev=1177491&view=rev
Log:
avoid unnecessary map allocation

Modified:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java?rev=1177491&r1=1177490&r2=1177491&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java Fri Sep 30 03:28:51 2011
@@ -159,23 +159,20 @@ public class LateralCache
     protected Map<Serializable, ICacheElement> processGetMatching( String pattern )
         throws IOException
     {
-        Map<Serializable, ICacheElement> elements = new HashMap<Serializable, ICacheElement>();
-
         if ( this.lateralCacheAttribures.getPutOnlyMode() )
         {
-            return Collections.emptyMap();
+            return Collections.<Serializable, ICacheElement>emptyMap();
         }
         try
         {
-            elements = lateralCacheService.getMatching( cacheName, pattern );
+            return lateralCacheService.getMatching( cacheName, pattern );
         }
         catch ( IOException e )
         {
             log.error( e );
             handleException( e, "Failed to getMatching [" + pattern + "] from " + lateralCacheAttribures.getCacheName() + "@" + lateralCacheAttribures );
+            return Collections.<Serializable, ICacheElement>emptyMap();
         }
-
-        return elements;
     }
 
     /**