Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BBB7D9B16 for ; Mon, 16 Apr 2012 15:04:44 +0000 (UTC) Received: (qmail 32157 invoked by uid 500); 16 Apr 2012 15:04:44 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 32059 invoked by uid 500); 16 Apr 2012 15:04:43 -0000 Mailing-List: contact dev-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 dev@felix.apache.org Received: (qmail 32041 invoked by uid 99); 16 Apr 2012 15:04:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2012 15:04:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2012 15:04:40 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DA10635378B for ; Mon, 16 Apr 2012 15:04:18 +0000 (UTC) Date: Mon, 16 Apr 2012 15:04:18 +0000 (UTC) From: "Thomas Watson (Updated) (JIRA)" To: dev@felix.apache.org Message-ID: <960760358.28736.1334588658904.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <449805907.26499.1334492476235.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (FELIX-3463) Multiple hosts for a fragment that exports a package causes ArrayIndexOutOfBoundsException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-3463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Watson updated FELIX-3463: --------------------------------- Attachment: 3463.txt Possible fix. > Multiple hosts for a fragment that exports a package causes ArrayIndexOutOfBoundsException > ------------------------------------------------------------------------------------------ > > Key: FELIX-3463 > URL: https://issues.apache.org/jira/browse/FELIX-3463 > Project: Felix > Issue Type: Bug > Components: Resolver > Environment: All > Reporter: Thomas Watson > Attachments: 3463.txt > > > Sample manifests: > Bundle-ManifestVersion: 2 > Bundle-SymbolicName: h1 > Bundle-Version: 1.0.0 > Export-Package: > h1.a; version=1.0, > h1.b; version=1.0; uses:="h1.a" > Bundle-ManifestVersion: 2 > Bundle-SymbolicName: h1 > Bundle-Version: 1.1.0 > Export-Package: > h1.a; version=1.0, > h1.b; version=1.0; uses:="h1.a" > Bundle-ManifestVersion: 2 > Bundle-SymbolicName: f1 > Bundle-Version: 1.0.0 > Export-Package: > f1.a; version=1.0;uses:="h1.a" > Fragment-Host: h1 > Bundle-ManifestVersion: 2 > Bundle-SymbolicName: b3 > Bundle-Version: 1.0.0 > Import-Package: f1.a > Then attempt to resolve b3. When inserting the HostedCapabilities an attempt is made to remove the original capability from the fragment. But it has already been removed when processing the first host. I think you could do a simple check for -1 before attempting to remove the original capability. > java.lang.ArrayIndexOutOfBoundsException: -1 > at java.util.ArrayList.remove(ArrayList.java:390) > at org.apache.felix.resolver.Candidates.prepare(Candidates.java:760) > at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:125) > at org.eclipse.osgi.container.ModuleResolver$ResolveProcess.resolve(ModuleResolver.java:378) > at org.eclipse.osgi.container.ModuleResolver.resolveDelta(ModuleResolver.java:47) > at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:238) > at org.eclipse.osgi.tests.TestModuleContainer.testMultiHost(TestModuleContainer.java:66) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) > at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) > at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) > at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) > at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) > at org.junit.runners.ParentRunner.run(ParentRunner.java:236) > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira