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 ListUtil and Fields classes #1926

Closed

Conversation

andreisilviudragnea
Copy link
Contributor

  • Removed ListUtil class in favor of Java 8 Streams
  • Removed unused Fields class

Copy link
Contributor

@grimreaper grimreaper left a comment

Choose a reason for hiding this comment

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

(I'm not a committer)

LGTM


if (verifiedOnly.isEmpty()) {
return null;
} else {
return verifiedOnly.getLast();
return verifiedOnly.get(verifiedOnly.size() - 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be .reduce((first, second) -> second).orElse(null)

Copy link

Choose a reason for hiding this comment

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

Isnt the existing:

  • more readable
  • performant, getLast is O(1) for array and linked list

Sorry for the silly question.

@TimvdLippe
Copy link
Contributor

I have to check whether this breaks Android projects 😢

@andreisilviudragnea
Copy link
Contributor Author

Yes, I would expect someone to use it outside of Mockito. Maybe just not using it internally anymore.

@TimvdLippe
Copy link
Contributor

Sadly we can't adopt this PR for now, given that it breaks our Android users. However much I would love to merge, it sadly breaks too many users for now. Hopefully we can revisit this in the future once the Android ecosystem has caught up with Java.

Apologies for the late response.

@andreisilviudragnea
Copy link
Contributor Author

andreisilviudragnea commented Mar 14, 2022

@TimvdLippe What about still deprecating them and leaving them around? What did you mean by our Android users? I want to check those usages to see if the solution in #2593 is good.

@TimvdLippe
Copy link
Contributor

We merged this after all in #2593, as it didn't break our Android api compatibility (SDK 24+). Thanks @andreisilviudragnea for getting back to us!

@andreisilviudragnea andreisilviudragnea deleted the remove-list-util branch March 17, 2022 15:37
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.

None yet

4 participants