camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1442561 - /camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java
Date Tue, 05 Feb 2013 12:30:00 GMT
Author: davsclaus
Date: Tue Feb  5 12:30:00 2013
New Revision: 1442561

URL: http://svn.apache.org/viewvc?rev=1442561&view=rev
Log:
CAMEL-6038: Fixed potential NPE if symbolic name is null.

Modified:
    camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java

Modified: camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java?rev=1442561&r1=1442560&r2=1442561&view=diff
==============================================================================
--- camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java
(original)
+++ camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java
Tue Feb  5 12:30:00 2013
@@ -50,7 +50,12 @@ public class OsgiManagementNameStrategy 
     @Override
     protected String customResolveManagementName(String pattern, String answer) {
         String bundleId = "" + bundleContext.getBundle().getBundleId();
-        String symbolicName = Matcher.quoteReplacement(bundleContext.getBundle().getSymbolicName());
+        String symbolicName = bundleContext.getBundle().getSymbolicName();
+        if (symbolicName != null) {
+            symbolicName = Matcher.quoteReplacement(symbolicName);
+        } else {
+            symbolicName = "";
+        }
         String version = Matcher.quoteReplacement(bundleContext.getBundle().getVersion().toString());
 
         answer = answer.replaceFirst("#bundleId#", bundleId);



Mime
View raw message