Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B3274D35A for ; Tue, 5 Feb 2013 12:31:27 +0000 (UTC) Received: (qmail 86458 invoked by uid 500); 5 Feb 2013 12:31:27 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 86406 invoked by uid 500); 5 Feb 2013 12:31:27 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 86391 invoked by uid 99); 5 Feb 2013 12:31:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2013 12:31:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2013 12:31:25 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7CF7B2388980; Tue, 5 Feb 2013 12:31:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1442562 - in /camel/branches/camel-2.10.x: ./ components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java Date: Tue, 05 Feb 2013 12:31:05 -0000 To: commits@camel.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130205123105.7CF7B2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Tue Feb 5 12:31:05 2013 New Revision: 1442562 URL: http://svn.apache.org/viewvc?rev=1442562&view=rev Log: CAMEL-6038: Fixed potential NPE if symbolic name is null. Modified: camel/branches/camel-2.10.x/ (props changed) camel/branches/camel-2.10.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java Propchange: camel/branches/camel-2.10.x/ ------------------------------------------------------------------------------ Merged /camel/trunk:r1442561 Propchange: camel/branches/camel-2.10.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.10.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java?rev=1442562&r1=1442561&r2=1442562&view=diff ============================================================================== --- camel/branches/camel-2.10.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java (original) +++ camel/branches/camel-2.10.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiManagementNameStrategy.java Tue Feb 5 12:31:05 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);