cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1421946 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
Date Fri, 14 Dec 2012 15:51:08 GMT
Author: dkulp
Date: Fri Dec 14 15:51:07 2012
New Revision: 1421946

URL: http://svn.apache.org/viewvc?rev=1421946&view=rev
Log:
[CXF-4703] Slight optimization

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1421946&r1=1421945&r2=1421946&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Fri Dec 14 15:51:07
2012
@@ -94,7 +94,11 @@ public class CXFBusImpl extends Abstract
 
     public final <T> T getExtension(Class<T> extensionType) {
         Object obj = extensions.get(extensionType);
-        if (obj == null && !missingExtensions.contains(extensionType)) {
+        if (obj == null) {
+            if (missingExtensions.contains(extensionType)) {
+                //already know we cannot find it
+                return null;
+            }
             ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
             if (loc == null) {
                 loc = createConfiguredBeanLocator();
@@ -113,6 +117,7 @@ public class CXFBusImpl extends Abstract
         if (null != obj) {
             return extensionType.cast(obj);
         } else {
+            //record that it couldn't be found to avoid expensive searches again in the future
             missingExtensions.add(extensionType);
         }
         return null;



Mime
View raw message