openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1308028 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
Date Sun, 01 Apr 2012 08:24:21 GMT
Author: struberg
Date: Sun Apr  1 08:24:21 2012
New Revision: 1308028

URL: http://svn.apache.org/viewvc?rev=1308028&view=rev
Log:
OWB-658 move auto @Default detection to increase cache hits

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java?rev=1308028&r1=1308027&r2=1308028&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
Sun Apr  1 08:24:21 2012
@@ -70,6 +70,7 @@ public class InjectionResolver
     private WebBeansContext webBeansContext;
     
     private final static Annotation[] DEFAULT_LITERAL_ARRAY = new Annotation[]{new DefaultLiteral()};
+    private final static Annotation[] ANY_LITERAL_ARRAY = new Annotation[]{new AnyLiteral()};
 
     /**
      * This Map contains all resolved beans via it's type and qualifiers.
@@ -452,24 +453,12 @@ public class InjectionResolver
             bdaBeansXMLFilePath = getBDABeansXMLPath(injectinPointClass);
         }
 
-        Long cacheKey = getBeanCacheKey(injectionPointType, bdaBeansXMLFilePath, qualifiers);
-
-        Set<Bean<?>> resolvedComponents = resolvedBeansByType.get(cacheKey);
-        if (resolvedComponents != null)
-        {
-            return resolvedComponents;
-        }
-
-        resolvedComponents = new HashSet<Bean<?>>();
-
         boolean currentQualifier = false;
-        boolean returnAll = false;
 
         if (isInstanceOrEventInjection(injectionPointType))
         {
-            qualifiers = new Annotation[]{new AnyLiteral()};
+            qualifiers = ANY_LITERAL_ARRAY;
         }
-
         else
         {
             if (qualifiers.length == 0)
@@ -479,6 +468,18 @@ public class InjectionResolver
             }
         }
 
+        Long cacheKey = getBeanCacheKey(injectionPointType, bdaBeansXMLFilePath, qualifiers);
+
+        Set<Bean<?>> resolvedComponents = resolvedBeansByType.get(cacheKey);
+        if (resolvedComponents != null)
+        {
+            return resolvedComponents;
+        }
+
+        resolvedComponents = new HashSet<Bean<?>>();
+
+        boolean returnAll = false;
+
         if (injectionPointType.equals(Object.class) && currentQualifier)
         {
             returnAll = true;



Mime
View raw message