Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 17752 invoked from network); 1 Jul 2009 19:19:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Jul 2009 19:19:42 -0000 Received: (qmail 80633 invoked by uid 500); 1 Jul 2009 19:19:52 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 80576 invoked by uid 500); 1 Jul 2009 19:19:52 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 80567 invoked by uid 99); 1 Jul 2009 19:19:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jul 2009 19:19:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Wed, 01 Jul 2009 19:19:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7C9B6238888E; Wed, 1 Jul 2009 19:19:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r790324 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Date: Wed, 01 Jul 2009 19:19:30 -0000 To: commits@felix.apache.org From: rickhall@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090701191930.7C9B6238888E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rickhall Date: Wed Jul 1 19:19:30 2009 New Revision: 790324 URL: http://svn.apache.org/viewvc?rev=790324&view=rev Log: Make sure we return null for PackageAdmin.getBundle(Class) when the bundle is from a different framework. (FELIX-1292) Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=790324&r1=790323&r2=790324&view=diff ============================================================================== --- felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original) +++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Wed Jul 1 19:19:30 2009 @@ -3055,9 +3055,11 @@ { if (clazz.getClassLoader() instanceof ModuleClassLoader) { - IModule module = + // Only return the bundle if it is from this framework. + ModuleImpl module = (ModuleImpl) ((ModuleClassLoader) clazz.getClassLoader()).getModule(); - return module.getBundle(); + return (((BundleImpl) module.getBundle()).getFramework() == this) + ? module.getBundle() : null; } try {