[jira] [Commented] (SLING-6131) MapEntries: Invalid logic around added/changed/removed property names
[ https://issues.apache.org/jira/browse/SLING-6131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15565811#comment-15565811 ] Carsten Ziegeler commented on SLING-6131: - It seems the "else" part is not sending an OSGi event if the mapping changed. > MapEntries: Invalid logic around added/changed/removed property names > - > > Key: SLING-6131 > URL: https://issues.apache.org/jira/browse/SLING-6131 > Project: Sling > Issue Type: Bug > Components: ResourceResolver >Reporter: Bertrand Delacretaz >Assignee: Carsten Ziegeler >Priority: Critical > Fix For: Resource Resolver 1.4.20 > > > The SLING-6000 changes have introduced code that looks incorrect and breaks a > number of integration tests (MappingEventsProxyTest, > ResourceResolverProxyTest, VanityPathTest) as (for example) changing a single > property of a map entry does not cause MapEntries to send events anymore. > In the affected code below, from the MapEntries class, the changedAttributes > and removedAttributes section are not reached if addedAttributes is null, I > don't think that's intentional. > [~cziegeler] could you have a look? I have assigned this to you as IIUC you > wrote that SLING-6000 code. > This is blocking SLING-5135 but I'll commit that code and disable the > affected integration tests until this is fixed. > {code} > Set addedAttributes = rc.getAddedPropertyNames(); > if (addedAttributes != null) { > ... > wasResolverRefreshed = doAddAttributes(path, addedAttributes, > wasResolverRefreshed); > ... > Set changedAttributes = rc.getChangedPropertyNames(); > ... > Set removedAttributes = rc.getRemovedPropertyNames(); > } else { > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-6131) MapEntries: Invalid logic around added/changed/removed property names
[ https://issues.apache.org/jira/browse/SLING-6131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15565788#comment-15565788 ] Bertrand Delacretaz commented on SLING-6131: Ok, I see, so I suppose something else is wrong as this breaks the mentioned tests: if you create a new mapping the {{TOPIC_RESOURCE_RESOLVER_MAPPING_CHANGED}} events are correctly delivered, but if you later change its {{sling:vanityPath}} property, for example, no such events are generated. > MapEntries: Invalid logic around added/changed/removed property names > - > > Key: SLING-6131 > URL: https://issues.apache.org/jira/browse/SLING-6131 > Project: Sling > Issue Type: Bug > Components: ResourceResolver >Reporter: Bertrand Delacretaz >Assignee: Carsten Ziegeler >Priority: Critical > Fix For: Resource Resolver 1.4.20 > > > The SLING-6000 changes have introduced code that looks incorrect and breaks a > number of integration tests (MappingEventsProxyTest, > ResourceResolverProxyTest, VanityPathTest) as (for example) changing a single > property of a map entry does not cause MapEntries to send events anymore. > In the affected code below, from the MapEntries class, the changedAttributes > and removedAttributes section are not reached if addedAttributes is null, I > don't think that's intentional. > [~cziegeler] could you have a look? I have assigned this to you as IIUC you > wrote that SLING-6000 code. > This is blocking SLING-5135 but I'll commit that code and disable the > affected integration tests until this is fixed. > {code} > Set addedAttributes = rc.getAddedPropertyNames(); > if (addedAttributes != null) { > ... > wasResolverRefreshed = doAddAttributes(path, addedAttributes, > wasResolverRefreshed); > ... > Set changedAttributes = rc.getChangedPropertyNames(); > ... > Set removedAttributes = rc.getRemovedPropertyNames(); > } else { > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-6131) MapEntries: Invalid logic around added/changed/removed property names
[ https://issues.apache.org/jira/browse/SLING-6131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15565726#comment-15565726 ] Carsten Ziegeler commented on SLING-6131: - [~bdelacretaz] The change is actually intentional. If the addedAttributes is null, it means that no information about attributes is delivered. Only if it is not null, it means that added/changed/removed are reported, it might be empty in this case. Nevertheless, if it is null it goes into the else case which should work nevertheless > MapEntries: Invalid logic around added/changed/removed property names > - > > Key: SLING-6131 > URL: https://issues.apache.org/jira/browse/SLING-6131 > Project: Sling > Issue Type: Bug > Components: ResourceResolver >Reporter: Bertrand Delacretaz >Assignee: Carsten Ziegeler >Priority: Minor > > The SLING-6000 changes have introduced code that looks incorrect and breaks a > number of integration tests (MappingEventsProxyTest, > ResourceResolverProxyTest, VanityPathTest) as (for example) changing a single > property of a map entry does not cause MapEntries to send events anymore. > In the affected code below, from the MapEntries class, the changedAttributes > and removedAttributes section are not reached if addedAttributes is null, I > don't think that's intentional. > [~cziegeler] could you have a look? I have assigned this to you as IIUC you > wrote that SLING-6000 code. > This is blocking SLING-5135 but I'll commit that code and disable the > affected integration tests until this is fixed. > {code} > Set addedAttributes = rc.getAddedPropertyNames(); > if (addedAttributes != null) { > ... > wasResolverRefreshed = doAddAttributes(path, addedAttributes, > wasResolverRefreshed); > ... > Set changedAttributes = rc.getChangedPropertyNames(); > ... > Set removedAttributes = rc.getRemovedPropertyNames(); > } else { > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)