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

John Ross commented on ARIES-1439:
----------------------------------

Equinox uses a version of the Felix Resolver that is not far from the latest. 
The org.apache.felix.resolver.util.CopyOnWriteList.add method does not throw an 
UnsupportedOperationException there. Looks like the change first appears here: 
http://svn.apache.org/viewvc?view=revision&revision=1690730. Please note that 
although CopyOnWriteList is in an internal package, the implementation has been 
publicly exposed to implementers of the ResolveContext via the 
insertHostedCapability method, and this is a breaking change.

> Aries ResolveContext.insertHostedCapability() calls unsupported add() method 
> on capabilies
> ------------------------------------------------------------------------------------------
>
>                 Key: ARIES-1439
>                 URL: https://issues.apache.org/jira/browse/ARIES-1439
>             Project: Aries
>          Issue Type: Bug
>          Components: Subsystem
>    Affects Versions: subsystem-core-2.0.4
>            Reporter: David Bosschaert
>            Assignee: David Bosschaert
>             Fix For: subsystem-2.0.6
>
>
> The method 
> {code}org.apache.aries.subsystem.core.internal.ResolveContext.insertHostedCapability(List<Capability>
>  capabilities, HostedCapability hostedCapability){code}
> calls {{capabilities.add(hostedCapability)}}.
> However the key reason for this callback is to insert this capability at the 
> correct position in the capabilities list. The Felix implementation of the 
> List provided insist on a call to {{add(idx, capability)}} which seems to 
> make sense in this context. 
> Currently this call causes the following exception:
> {code}java.lang.UnsupportedOperationException: null
>       at 
> org.apache.felix.resolver.util.CopyOnWriteList.add(CopyOnWriteList.java:135)
>       at 
> org.apache.aries.subsystem.core.internal.ResolveContext.insertHostedCapability(ResolveContext.java:101)
>       at org.apache.felix.resolver.Candidates.prepare(Candidates.java:934)
>       at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:232)
>       at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:158)
>       at 
> org.apache.aries.subsystem.core.internal.SubsystemResource.computeDependencies(SubsystemResource.java:372){code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to