[
https://issues.apache.org/jira/browse/SLING-5494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15137074#comment-15137074
]
ASF GitHub Bot commented on SLING-5494:
---------------------------------------
GitHub user tmaret opened a pull request:
https://github.com/apache/sling/pull/122
SLING-5494 - Discovery InstancesDiff.retained() implementation not
according to API doc
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tmaret/sling SLING-5494
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/sling/pull/122.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #122
----
commit e397aee4da4a63967b3e2e8e6abfd253c476787e
Author: tmaret <[email protected]>
Date: 2016-02-08T15:25:58Z
SLING-5494 - Discovery InstancesDiff.retained() implementation not
according to API doc
* Match the API with the implementation
----
> 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)