You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2012/01/19 14:27:46 UTC

svn commit: r1233363 - in /cxf/branches/2.4.x-fixes: ./ api/src/main/java/org/apache/cxf/BusFactory.java

Author: sergeyb
Date: Thu Jan 19 13:27:46 2012
New Revision: 1233363

URL: http://svn.apache.org/viewvc?rev=1233363&view=rev
Log:
Merged revisions 1233359 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes

................
  r1233359 | sergeyb | 2012-01-19 13:25:23 +0000 (Thu, 19 Jan 2012) | 9 lines
  
  Merged revisions 1233355 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1233355 | sergeyb | 2012-01-19 13:23:11 +0000 (Thu, 19 Jan 2012) | 1 line
    
    [CXF-4045] Updating BusFactory to catch NoClassDefFoundError with minor refactoring to pass the Checkstyle
  ........
................

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 19 13:27:46 2012
@@ -1,2 +1,2 @@
-/cxf/branches/2.5.x-fixes:1233076,1233113,1233296,1233311
-/cxf/trunk:1233075,1233112,1233289-1233294,1233308
+/cxf/branches/2.5.x-fixes:1233076,1233113,1233296,1233311,1233359
+/cxf/trunk:1233075,1233112,1233289-1233294,1233308,1233355

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java?rev=1233363&r1=1233362&r2=1233363&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java Thu Jan 19 13:27:46 2012
@@ -297,25 +297,24 @@ public abstract class BusFactory {
                 busFactoryCondition = rd.readLine();
                 rd.close();
             }
-            if (isValidBusFactoryClass(busFactoryClass)) {
-                if (busFactoryCondition != null) {
-                    try {
-                        Class<?> cls =  ClassLoaderUtils.loadClass(busFactoryClass, BusFactory.class)
-                            .asSubclass(BusFactory.class);
-                        int idx = busFactoryCondition.indexOf(',');
-                        while (idx != -1) {
-                            cls.getClassLoader().loadClass(busFactoryCondition.substring(0, idx));
-                            busFactoryCondition = busFactoryCondition.substring(idx + 1);
-                            idx = busFactoryCondition.indexOf(',');
-                        }
-                        cls.getClassLoader().loadClass(busFactoryCondition);
-                        return busFactoryClass;
-                    } catch (ClassNotFoundException e) {
-                        return DEFAULT_BUS_FACTORY;
+            if (isValidBusFactoryClass(busFactoryClass) 
+                && busFactoryCondition != null) {
+                try {
+                    Class<?> cls =  ClassLoaderUtils.loadClass(busFactoryClass, BusFactory.class)
+                        .asSubclass(BusFactory.class);
+                    int idx = busFactoryCondition.indexOf(',');
+                    while (idx != -1) {
+                        cls.getClassLoader().loadClass(busFactoryCondition.substring(0, idx));
+                        busFactoryCondition = busFactoryCondition.substring(idx + 1);
+                        idx = busFactoryCondition.indexOf(',');
                     }
-                } else {
-                    return busFactoryClass;
+                    cls.getClassLoader().loadClass(busFactoryCondition);
+                } catch (ClassNotFoundException e) {
+                    busFactoryClass = DEFAULT_BUS_FACTORY;
+                } catch (NoClassDefFoundError e) {
+                    busFactoryClass = DEFAULT_BUS_FACTORY;
                 }
+                
             }
             return busFactoryClass;