cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1212901 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
Date Sat, 10 Dec 2011 22:20:14 GMT
Author: ay
Date: Sat Dec 10 22:20:13 2011
New Revision: 1212901

URL: http://svn.apache.org/viewvc?rev=1212901&view=rev
Log:
[CXF-3971] SpringBus.getId() may fail to determine the symbolic bundle name

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

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java?rev=1212901&r1=1212900&r2=1212901&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java Sat Dec 10 22:20:13
2011
@@ -135,10 +135,11 @@ public class SpringBus extends Extension
     public String getId() {
         if (id == null) {
             try {
-                Class<?> cls = Class.forName("org.osgi.framework.BundleContext");
-                Object o = getExtension(cls);
-                Object o2 = o.getClass().getMethod("getBundle").invoke(o);
-                String s = (String)o2.getClass().getMethod("getSymbolicName").invoke(o2);
+                Class<?> clsbc = Class.forName("org.osgi.framework.BundleContext");
+                Class<?> clsb = Class.forName("org.osgi.framework.Bundle");
+                Object o = getExtension(clsbc);
+                Object o2 = clsbc.getMethod("getBundle").invoke(o);
+                String s = (String)clsb.getMethod("getSymbolicName").invoke(o2);
                 id = s + "-" + DEFAULT_BUS_ID + Integer.toString(this.hashCode());
             } catch (Throwable t) {
                 id = super.getId();



Mime
View raw message