cmailleux    2005/08/03 13:33:09 CEST

  Modified files:
    core/src/java/org/jahia/spring/advice CacheAdvice.java 
  Log:
  Rewrite Method toGroupCacheKey to avoid use of arguments_key in public method
  
  Revision  Changes    Path
  1.3       +13 -2     
jahia/core/src/java/org/jahia/spring/advice/CacheAdvice.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/spring/advice/CacheAdvice.java.diff?r1=1.2&r2=1.3&f=h
  
  
  
  Index: CacheAdvice.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/java/org/jahia/spring/advice/CacheAdvice.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CacheAdvice.java  3 Aug 2005 10:38:17 -0000       1.2
  +++ CacheAdvice.java  3 Aug 2005 11:33:09 -0000       1.3
  @@ -34,7 +34,7 @@
           if (cache == null) {
               cache = cacheService.createCacheInstance(cacheName);
           }
  -        GroupCacheKey entryKey = 
toGroupCacheKey(methodInvocation.getArguments());
  +        GroupCacheKey entryKey = 
toGroupCacheKeyInternal(methodInvocation.getArguments());
           if (cache != null) {
               returnValue = cache.get(entryKey);
               if (log.isDebugEnabled()) {
  @@ -53,7 +53,7 @@
           return returnValue;
       }
   
  -    public static GroupCacheKey toGroupCacheKey(Object[] array) {
  +    private GroupCacheKey toGroupCacheKeyInternal(Object[] array) {
           List list = new ArrayList(array.length);
           StringBuffer buffer = new StringBuffer(512);
           for (int i = 0; i < array.length; i++) {
  @@ -63,4 +63,15 @@
           }
           return new GroupCacheKey(buffer.toString(),list);
       }
  +
  +    public static GroupCacheKey toGroupCacheKey(Object[] array) {
  +        List list = new ArrayList(array.length);
  +        StringBuffer buffer = new StringBuffer(512);
  +        for (int i = 0; i < array.length; i++) {
  +            Object o = array[i];
  +            list.add(o);
  +            buffer.append(o.toString());
  +        }
  +        return new GroupCacheKey(buffer.toString(),list);
  +    }
   }
  

Reply via email to