You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stefan Bischof (Jira)" <ji...@apache.org> on 2020/09/25 19:53:00 UTC

[jira] [Comment Edited] (FELIX-6335) String+ service property value of certain collection types causes incorrect dependency handling

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

Stefan Bischof edited comment on FELIX-6335 at 9/25/20, 7:52 PM:
-----------------------------------------------------------------

Spec R8:

10.1.7.21
 ```

public ServiceRegistration<?> registerService(String[] clazzes, Object service, Dictionary<String, ?>properties)
 ```
 properties: 
 The properties for this service. The keys in the properties object must all be String objects. See Constants for a list of standard service property keys. *Changes should not**be made to this object after calling this method.

10.1.30.3
 ```

public void setProperties(Dictionary<String, ?> properties)
 ```
 properties:
 The properties for this service. See Constants for a list of standard service property keys. *Changes* *should not be made to this object after calling this method*. To update the service's properties this method should be called again*.

*


was (Author: bischofs@jena.de):
Spec R8:

10.1.7.21
```

public ServiceRegistration<?> registerService(String[] clazzes, Object service, Dictionary<String, ?>properties)
```
properties: 
The properties for this service. The keys in the properties object must all be String objects. See Constants for a list of standard service property keys. *Changes should not**be made to this object after calling this method. 

* 10.1.30.3
```


public void setProperties(Dictionary<String, ?> properties)
```
properties:
The properties for this service. See Constants for a list of standard service property keys. *Changes* *should not be made to this object after calling this method*. To update the service's properties this method should be called again*.


*

> String+ service property value of certain collection types causes incorrect dependency handling
> -----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-6335
>                 URL: https://issues.apache.org/jira/browse/FELIX-6335
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: scr-2.1.24
>            Reporter: Mark Hoffmann
>            Priority: Major
>         Attachments: demo.test.zip
>
>
> I think it is an SCR problem, because the problem occurs with Equinox or Felix as framework.
> Someone changes a ServiceRegistration for a service *A,* that  will be updated using setProperties, as soon something changes.
> One of the property values for the registration is String+ that should accept a collection.
> Another component *K* should be activated or deactivated, depending on a reference binding to *A* with a certain target filter for *A*'s properties
> I experienced that *K* is always activated correctly. But it will not de-activate, if the target filter for *A* does not match anymore, when the registration properties are changed using certain collection types like e.g. _Collections#unmodifiableList_ as property value.
> Changing the value to an ordinary list, everything behaves correct.
> I attached a bnd based test, that illustrates the problem. There are 3 tests that are working as expected and 3 tests failing. I deactivated two of these failing tests, because feiling just one test casuses an invalid state in the framework.
> I am not sure, if the rejection of certain collection types eventually by intention. But it has a large impact to the behavior of the framework.
> At least ther should be an warning or exception, that tells the user, that he uses  invalid types.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)