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

Upgrade to Java 21 #395

Open
mthmulders opened this issue Aug 8, 2024 · 2 comments
Open

Upgrade to Java 21 #395

mthmulders opened this issue Aug 8, 2024 · 2 comments
Milestone

Comments

@mthmulders
Copy link
Owner

There are a few spots in the code where using Java 21 (more specifically, switch with instanceof patterns) would be beneficial.

@mthmulders mthmulders added this to the 1.0 milestone Aug 8, 2024
@shaikhu
Copy link
Contributor

shaikhu commented Aug 26, 2024

Hi @mthmulders , just an FYI, since you mentioned pattern matching for switch, the Palantir Java Format (declared in mcs pom here) currently doesn't support it. See this Github issue. I did some testing on my forked repo, and the problem seems to be when using a guard condition.

Also I tested on my fork, configuring spotless to use Google Java Format successfully works with jdk 21 and pattern matching for switch (with the guard condition). Seems a bit drastic to switch though (introduces a lot of formatting changes). Alternatively maybe upgrade to jdk 21 and not use pattern matching for switch, until palantir format supports it?

@mthmulders
Copy link
Owner Author

Thanks for the initial investigation, @shaikhu! Upgrading to Java 21 is not (yet) necessary. It's something I'd like to do "at some point". I can patiently wait until the Palantir Java formatter starts understanding pattern matching w/ switch. At this point, using a different formatting style (that is probably less lambda-friendly and also has narrower lines feels) a bit drastic.

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

No branches or pull requests

2 participants