cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1422005 - /cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
Date Fri, 14 Dec 2012 17:55:35 GMT
Author: dkulp
Date: Fri Dec 14 17:55:34 2012
New Revision: 1422005

URL: http://svn.apache.org/viewvc?rev=1422005&view=rev
Log:
Merged revisions 1421946 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1421946 | dkulp | 2012-12-14 10:51:07 -0500 (Fri, 14 Dec 2012) | 2 lines

  [CXF-4703] Slight optimization

........

Modified:
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1422005&r1=1422004&r2=1422005&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Fri
Dec 14 17:55:34 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