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

FormatterFunc no longer extends Function or BiFunction #638

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

nedtwigg
Copy link
Member

@nedtwigg nedtwigg commented Jul 2, 2020

This is a breaking change in the hierarchy of one of Spotless' deepest abstractions, but we've had no problems with it at all. From that point of view, this is a very dumb change.

I was just curious "what would break if I delete the extends Function ... BiFunction thing?", and the answer was, nothing. Nothing broke at all, not a single other code change was needed.

I'm not quite sure what to make of that, except that Java's idea of "target typing" is extremely practical. When I realized that we could make this change, I wasn't sure if we should do it or not. Here's how I see it:

  • Pros: FormatterFunc is simpler without out it (technically...)
  • Cons: It's an unnecessary breaking change, just because we can squeeze it in with the rest of 2.0 doesn't mean we have to
  • Trump card: We can add it back later, and it wouldn't be a breaking change

@jbduncan just FYI

@nedtwigg nedtwigg merged commit 1a19b3f into main Jul 2, 2020
@nedtwigg nedtwigg deleted the feat/simplify-formatter-func branch July 2, 2020 06:29
@jbduncan
Copy link
Member

jbduncan commented Jul 2, 2020

@nedtwigg Thanks for warning me about this change!

Yep, this is fine with me, given that with hindsight it's easy to target different functional interfaces with method references.

So LGTM. 👍

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