[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    svn commit: r1177491 -
From:       dbrosius () apache ! org
Date:       2011-09-30 3:28:51
Message-ID: 20110930032852.08B5023888FE () eris ! apache ! org
[Download RAW message or body]

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;
     }
 
     /**


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic