You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2012/11/02 10:11:13 UTC

[jira] [Created] (DOSGI-137) Possible bug in TopologyManagerImport when checking if an Endpoint is already imported

Christian Schneider created DOSGI-137:
-----------------------------------------

             Summary: Possible bug in TopologyManagerImport when checking if an Endpoint is already imported
                 Key: DOSGI-137
                 URL: https://issues.apache.org/jira/browse/DOSGI-137
             Project: CXF Distributed OSGi
          Issue Type: Bug
    Affects Versions: 1.3.1
            Reporter: Christian Schneider
            Assignee: Christian Schneider
             Fix For: 1.4


In TopologyManagerImport.importServices we seem to check if we already imported an endpoint. (See snippet below).

----
    private void importServices(String filter) {        
        List<ImportRegistration> importRegistrations = getImportedServices(filter);
        for (EndpointDescription epd : importPossibilities.get(filter)) {
            if (!importRegistrations.contains(epd)) {
----

I have two concerns with this:

1. importRegistrations is a List<ImportRegistration> but we check using contains(epd) which is an EndpointDescription. I think this can never return true.

I have prepared a code that can fix this:
    private boolean alreadyImported(EndpointDescription epd, List<ImportRegistration> importRegistrations) {
        for (ImportRegistration ir : importRegistrations) {
            if (epd.equals(ir.getImportReference().getImportedEndpoint())) {
                return true;
            }
        }
        return false;
    }
As soon as I fix it though the second concern below may be an issue.

2. We only have one list of ImportRegistrations. In case a RemoteServiceAdmin is added this means that we would not add it to this new RemoteServiceAdmin. So the question here is: Do we want to import each service with each RSA or only with one?


So any ideas how to proceed here?


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (DOSGI-137) Possible bug in TopologyManagerImport when checking if an Endpoint is already imported

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DOSGI-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider resolved DOSGI-137.
---------------------------------------

    Resolution: Fixed
    
> Possible bug in TopologyManagerImport when checking if an Endpoint is already imported
> --------------------------------------------------------------------------------------
>
>                 Key: DOSGI-137
>                 URL: https://issues.apache.org/jira/browse/DOSGI-137
>             Project: CXF Distributed OSGi
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Christian Schneider
>            Assignee: Christian Schneider
>             Fix For: 1.4
>
>
> In TopologyManagerImport.importServices we seem to check if we already imported an endpoint. (See snippet below).
> ----
>     private void importServices(String filter) {        
>         List<ImportRegistration> importRegistrations = getImportedServices(filter);
>         for (EndpointDescription epd : importPossibilities.get(filter)) {
>             if (!importRegistrations.contains(epd)) {
> ----
> I have two concerns with this:
> 1. importRegistrations is a List<ImportRegistration> but we check using contains(epd) which is an EndpointDescription. I think this can never return true.
> I have prepared a code that can fix this:
>     private boolean alreadyImported(EndpointDescription epd, List<ImportRegistration> importRegistrations) {
>         for (ImportRegistration ir : importRegistrations) {
>             if (epd.equals(ir.getImportReference().getImportedEndpoint())) {
>                 return true;
>             }
>         }
>         return false;
>     }
> As soon as I fix it though the second concern below may be an issue.
> 2. We only have one list of ImportRegistrations. In case a RemoteServiceAdmin is added this means that we would not add it to this new RemoteServiceAdmin. So the question here is: Do we want to import each service with each RSA or only with one?
> So any ideas how to proceed here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira