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

John Ross commented on ARIES-1408:
----------------------------------

The issue here is the requirement argument given to 
RequireCapabilityHeader.valueOf can come from a remote repository. The same 
holds true for ImportPackageHeader, RequireBundleHeader, and 
SubsystemImportService header. However, the latter three do a namespace check 
instead. The instanceof check was used because Require-Capability uses custom 
namespaces. Nevertheless, it's an inappropriate check for the reason stated in 
the first sentence.

I'm very surprised there are no tests catching this, including the CT. There 
are numerous tests using remote repositories; however, I suspect that none of 
them contain resources with requirements that must become part of an 
application's computed Require-Capability header.

> The RequireCapabilityHeader currently only supports requirements defined by 
> the Aries implementation
> ----------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-1408
>                 URL: https://issues.apache.org/jira/browse/ARIES-1408
>             Project: Aries
>          Issue Type: Bug
>          Components: Subsystem
>    Affects Versions: subsystem-2.0.2
>            Reporter: Wouter Bancken
>             Fix For: subsystem-2.0.3
>
>
> The RequireCapabilityHeader currently only supports requirements defined by 
> the Aries implementation and it does not allow any custom Requirement 
> subclasses.
> This is caused by the following if statement:
> !(requirement instanceof RequireCapabilityRequirement                         
>                 || requirement instanceof OsgiExecutionEnvironmentRequirement)
> This statement was introduced to tackle the issues concerning the equals and 
> hashcode methods in ARIES-1387. A better solution to this issue would be to 
> use the equality specifications from the specs to determine equality of 
> clauses. 
> Additionally the current instanceof comparison only supports 
> RequireCapabilityRequirement and OsgiExecutionEnvironmentRequirement classes 
> from the aries classloader. IllegalArgumentExceptions will be thrown when 
> using a RequireCapabilityRequirement originating from a different classloader.



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

Reply via email to