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

Refactor com.jcabi.email.postman.PostNoLoops #43

Closed
amihaiemil opened this issue Apr 20, 2016 · 11 comments
Closed

Refactor com.jcabi.email.postman.PostNoLoops #43

amihaiemil opened this issue Apr 20, 2016 · 11 comments
Assignees

Comments

@amihaiemil
Copy link
Member

Currently the method

private boolean intersect(final Address[] first, final Address[] second, final String msg)

Is really huge and bluntly implemented.
It can be refactored to contain only a couple lines using Collections.retainAll().

I tried it and the tests passed fine.

    private boolean intersect(final Address[] first, final Address[] second,
        final String msg) {
        Collection<Address> firstCollection = new ArrayList<Address>(Arrays.asList(first));
        firstCollection.retainAll(Arrays.asList(second));
        boolean intersects = !firstCollection.isEmpty();
        if(intersects) {
            Logger.info(
                this,
                "Address(es) %s exist in both %s",
                firstCollection.toString(),msg
            );
        }
        return intersects;
    }

@dmarkov
Copy link

dmarkov commented Apr 25, 2016

@yegor256 take a look at this issue please and dispatch it somehow, see par.21

@amihaiemil
Copy link
Member Author

@yegor256 Can you have a look here pls? Thanks.

@yegor256 yegor256 added the bug label May 3, 2016
@dmarkov
Copy link

dmarkov commented May 3, 2016

@amihaiemil thanks for tis bug, I topped your account for 15 mins, transaction AP-61L70367K0547154P

@dmarkov
Copy link

dmarkov commented Aug 4, 2016

@prondzyn this ticket is yours now, please proceed, and keep in mind this. Any technical questions you should ask right here

Task's budget is 30 mins (see this for explanation)

prondzyn added a commit to prondzyn/jcabi-email that referenced this issue Aug 4, 2016
@prondzyn
Copy link
Contributor

prondzyn commented Aug 4, 2016

@dmarkov PR #49 prepared.

@dmarkov
Copy link

dmarkov commented Aug 4, 2016

@dmarkov PR #49 prepared.

@prondzyn thanks for that

prondzyn added a commit to prondzyn/jcabi-email that referenced this issue Aug 4, 2016
@prondzyn
Copy link
Contributor

prondzyn commented Aug 8, 2016

@amihaiemil please close the issue

@amihaiemil
Copy link
Member Author

Sure thanks :)

@dmarkov dmarkov added the DEV label Aug 9, 2016
@prondzyn
Copy link
Contributor

@dmarkov the task is done

@dmarkov
Copy link

dmarkov commented Aug 10, 2016

@dmarkov the task is done

@prondzyn thank you!

@dmarkov
Copy link

dmarkov commented Aug 10, 2016

@prondzyn Thank you, I have added 30 mins to your account in payment/transaction "AP-0TA95484RH258244L", time consumed: 120 hours and 49 mins; added +30 to your rating, now it is equal to +60

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

No branches or pull requests

4 participants