Skip to content

Remove distinct - #340

Closed
vvmsalat wants to merge 2 commits into
taskadapter:masterfrom
vvmsalat:patch-1
Closed

vvmsalat wants to merge 2 commits into
taskadapter:masterfrom
vvmsalat:patch-1

Conversation

@vvmsalat

Copy link
Copy Markdown

Removed distinct method to maintain multiple attribute handling when filtering by params.
See: #339

Removed distinct method to maintain multiple attribute handling when filtering by params.
See: taskadapter#339
@alexeyOnGitHub alexeyOnGitHub self-assigned this Feb 13, 2020
@alexeyOnGitHub

Copy link
Copy Markdown
Member

can you please add/update tests for this change?

@alexeyOnGitHub

Copy link
Copy Markdown
Member

@vvmsalat this seems to be a useful change. let's add tests for it?

@alexeyOnGitHub alexeyOnGitHub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to have tests.

return origParams
.stream()
.filter(Objects::nonNull)
.collect(Collectors.toMap(RequestParam::getValue, a -> a, (s1, s2) -> s1))

@vvmsalat vvmsalat Jul 3, 2020 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexeyOnGitHub like this, different
RequestParam{name='f[]', value='status_id'
RequestParam{name='f[]', value='cf_13' can be filtered, which is total need.
Still, if ever duplicate values occure, the map would skip one entry. Ideally the key/value pair should be duplicate checked.
But that's it for the moment.

@alexeyOnGitHub alexeyOnGitHub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a correct fix. it will drop all parameters with the same values. I added a test in "master" branch to demonstrate the problem.

@alexeyOnGitHub

Copy link
Copy Markdown
Member

please see the comments above - this change would introduce a bug into the library. closing this PR because there weren't any changes in it in about a year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants