felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Konstantinov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3463) Multiple hosts for a fragment that exports a package causes ArrayIndexOutOfBoundsException
Date Tue, 24 Mar 2015 15:57:52 GMT

    [ https://issues.apache.org/jira/browse/FELIX-3463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14378050#comment-14378050
] 

Dmitry Konstantinov commented on FELIX-3463:
--------------------------------------------

Could you please clarify - for which version the fix was applied?

> 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
>            Assignee: Richard S. Hall
>         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 was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message