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

Cherry-pick upstream changes. #615

Merged
merged 10 commits into from
Jan 10, 2022
Merged

Cherry-pick upstream changes. #615

merged 10 commits into from
Jan 10, 2022

Conversation

fawind
Copy link
Contributor

@fawind fawind commented Jan 7, 2022

After this PR

Cherry-pick a bunch of commits from google-java-format that contain logic fixes for newer Java versions.

Mostly 1:1 copy of the upstream change and rebasing them into the slightly changed structure of palantir-java-format.

==COMMIT_MSG==
Cherry-pick upstream changes.
==COMMIT_MSG==

Possible downsides?

Large list of changes but they all merged upstream and don't change our existing tests so this should be good.

cushon and others added 9 commits January 7, 2022 18:32
This implements support for JEP 409: Sealed Classes, see
https://openjdk.java.net/jeps/409.

The implementation handles the sealed and non-sealed keywords and sorts them
according to their JLS order.  This requires us to look at the actual text of
the Tok, as there’s no TokenKind for sealed and non-sealed.

The optional permits clause is handled in the same manner as the implements
clause. A new private method, classDeclarationTypeList, has been added to
facilitate this.

This fixes #603.

I implemented this in a manner that I deemed fit with the surrounding code, but if I missed something, don’t hesitate to get back to me and I’ll adjust this PR to suit.

Fixes #629

COPYBARA_INTEGRATE_REVIEW=google/google-java-format#629 from now:I603 4825e3310e00a1145304d64b4b73e9d3d03d08b3
PiperOrigin-RevId: 387160750
…` can be quite slow so it's best to avoid doing it repeatedly.

PiperOrigin-RevId: 387621256
for AST changes in Java 17, in particular the addition of CaseTree#getLabels,
which returns a single `DefaultCaseLabelTree` to represent the default case.

google/google-java-format#683
google/google-java-format#684

PiperOrigin-RevId: 411146137
@changelog-app
Copy link

changelog-app bot commented Jan 7, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Cherry-pick upstream changes.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from carterkozak January 7, 2022 18:24
@fawind
Copy link
Contributor Author

fawind commented Jan 7, 2022

Might be nice to rebase-merge this instead of squashing to keep the cherry-picked commits in the history for easier tracking.

@carterkozak
Copy link
Contributor

+1 for retaining original commit data

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.

6 participants