Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove offer duplicates in spread view #1506

Merged

Conversation

ripcurlx
Copy link
Contributor

@ripcurlx ripcurlx commented Apr 10, 2018

Fixes #1202.

I was only able to reproduce it in a test in the SpreadModel so I added an additional safeguard there.

Copy link
Member

@cbeams cbeams left a comment

Choose a reason for hiding this comment

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

utACK. Great that you were able to repro this at all, @ripcurlx! You'll see I called out a couple style nits, but looks good otherwise. Feel free to merge.

@@ -90,6 +94,12 @@ protected void deactivate() {
offerBookListItems.removeListener(listChangeListener);
}

private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor)
{
Copy link
Member

Choose a reason for hiding this comment

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

Nit: place opening brace on same line

public void testfilterSpreadItemsForUniqueOffers() {
OfferBook offerBook = mock(OfferBook.class);
PriceFeedService priceFeedService = mock(PriceFeedService.class);
final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList();
Copy link
Member

Choose a reason for hiding this comment

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

Nit: don't use final modifier on local variables unless strictly necessary (same for line 85 below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use it out of a habit. Does it have a disadvantage to use final everywhere by default and only not use it where necessary?

@ripcurlx ripcurlx merged commit a426e8f into bisq-network:master Apr 10, 2018
@ripcurlx ripcurlx deleted the remove-duplicates-in-spread-view branch September 5, 2018 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants