cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1497523 - in /cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension: Extension.java ExtensionManagerImpl.java
Date Thu, 27 Jun 2013 19:42:00 GMT
Author: dkulp
Date: Thu Jun 27 19:42:00 2013
New Revision: 1497523

URL: http://svn.apache.org/r1497523
Log:
Merged revisions 1497515 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1497515 | dkulp | 2013-06-27 15:28:41 -0400 (Thu, 27 Jun 2013) | 10 lines

  Merged revisions 1497481 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1497481 | dkulp | 2013-06-27 14:04:21 -0400 (Thu, 27 Jun 2013) | 2 lines

    [CXF-5099] Fix problem of optional extensions not being truely optional

  ........

........

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

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java?rev=1497523&r1=1497522&r2=1497523&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
Thu Jun 27 19:42:00 2013
@@ -230,19 +230,18 @@ public class Extension {
             }
             obj = cls.getConstructor().newInstance();
         } catch (ExtensionException ex) {
-            throw ex;
-        } catch (IllegalAccessException ex) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), ex);
-        } catch (InstantiationException ex) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), ex);
-        } catch (IllegalArgumentException e) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), e);
-        } catch (SecurityException e) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), e);
+            notFound = true;
+            if (!optional) {
+                throw ex;
+            }
         } catch (InvocationTargetException ex) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), 
-                                         ex.getCause());
+            notFound = true;
+            if (!optional) {
+                throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), 
+                                             ex.getCause());
+            }
         } catch (NoSuchMethodException ex) {
+            notFound = true;
             List<Object> a = new ArrayList<Object>();
             if (b != null) {
                 a.add(b);
@@ -250,8 +249,15 @@ public class Extension {
             if (args != null) {
                 a.add(args);
             }
-            throw new ExtensionException(new Message("PROBLEM_FINDING_CONSTRUCTOR", LOG,
-                                                     cls.getName(), a), ex);
+            if (!optional) {
+                throw new ExtensionException(new Message("PROBLEM_FINDING_CONSTRUCTOR", LOG,
+                                                         cls.getName(), a), ex);
+            }
+        } catch (Throwable e) {
+            notFound = true;
+            if (!optional) {
+                throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), e);
+            }
         }
         return obj;
     }

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java?rev=1497523&r1=1497522&r2=1497523&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
Thu Jun 27 19:42:00 2013
@@ -197,6 +197,9 @@ public class ExtensionManagerImpl implem
         }
  
         Object obj = e.load(loader, bus);
+        if (obj == null) {
+            return;
+        }
         
         Configurer configurer = (Configurer)(activated.get(Configurer.class));
         if (null != configurer) {



Mime
View raw message