You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Marc Pfaff (JIRA)" <ji...@apache.org> on 2016/02/08 16:14:39 UTC

[jira] [Commented] (SLING-5494) Discovery InstancesDiff.retained() implementation not according to API doc

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

Marc Pfaff commented on SLING-5494:
-----------------------------------

cc: [~marett], as discussed.

> Discovery InstancesDiff.retained() implementation not according to API doc
> --------------------------------------------------------------------------
>
>                 Key: SLING-5494
>                 URL: https://issues.apache.org/jira/browse/SLING-5494
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Discovery Commons 1.0.4
>            Reporter: Marc Pfaff
>
> The InstancesDiff.retained(boolean retainFromNewCollection, boolean propertyChanged) does not seem to be implemented according to the API docs. The property 'propertyChanged' is implemented the opposite way as in the API descriptions. Not sure whether implementation or API doc is right. 
> As per API the propertyChanged=false is supposed to return only the instances where properties have changed, and propertyChanged=true where properties have not changed.
> Looking at the test case in [3], which is passing, the implementation seems to behave the other way round. 
> * Suspect implementation [2]
> * Test case [3]
> [1] https://github.com/apache/sling/blob/trunk/bundles/extensions/discovery/commons/src/main/java/org/apache/sling/discovery/commons/InstancesDiff.java#L214
> [2] https://github.com/apache/sling/blob/7c4a53755aed1211c9af313a3973cd2543a7bbe0/bundles/extensions/discovery/commons/src/main/java/org/apache/sling/discovery/commons/InstancesDiff.java#L256
> [3] https://github.com/apache/sling/blob/trunk/bundles/extensions/discovery/commons/src/test/java/org/apache/sling/discovery/commons/InstancesDiffTest.java#L161



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