This is an automated email from the ASF dual-hosted git repository. martin_s pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/archiva-redback-components-spring-utils.git
commit b508f3f40468df3da98543c7baeaac1d58f2e70a Author: Olivier Lamy <[email protected]> AuthorDate: Mon Oct 15 07:27:13 2012 +0000 simplify debug code git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-components/trunk@1398204 13f79535-47bb-0310-9956-ffa450edef68 --- .../components/springutils/CachingByTypeBeanFactory.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/archiva/redback/components/springutils/CachingByTypeBeanFactory.java b/src/main/java/org/apache/archiva/redback/components/springutils/CachingByTypeBeanFactory.java index 7033b5e..7da01d9 100755 --- a/src/main/java/org/apache/archiva/redback/components/springutils/CachingByTypeBeanFactory.java +++ b/src/main/java/org/apache/archiva/redback/components/springutils/CachingByTypeBeanFactory.java @@ -43,13 +43,13 @@ public class CachingByTypeBeanFactory * @see org.springframework.beans.factory.support.DefaultListableBeanFactory#getBeanNamesForType(java.lang.Class) */ @Override - public String[] getBeanNamesForType( @SuppressWarnings( "rawtypes" ) Class type ) + public String[] getBeanNamesForType( @SuppressWarnings ( "rawtypes" ) Class type ) { return getBeanNamesForType( type, true, true ); } @Override - public String[] getBeanNamesForType( @SuppressWarnings( "rawtypes" ) Class type, boolean includeNonSingletons, + public String[] getBeanNamesForType( @SuppressWarnings ( "rawtypes" ) Class type, boolean includeNonSingletons, boolean allowEagerInit ) { TypeKey typeKey = new TypeKey( type, includeNonSingletons, allowEagerInit ); @@ -60,10 +60,9 @@ public class CachingByTypeBeanFactory } String[] value = super.getBeanNamesForType( type, includeNonSingletons, allowEagerInit ); // using this pattern as we prevent building a List - if ( log.isDebugEnabled() ) - { - log.debug( "will add to cache: {} : {}", typeKey, Arrays.asList( value ) ); - } + + log.debug( "will add to cache: {} : {}", typeKey, Arrays.asList( value ) ); + cachedBeanNamesForType.putIfAbsent( typeKey, value ); return value; } -- To stop receiving notification emails like this one, please contact [email protected].
