You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
There are a few spots in the code where using Java 21 (more specifically,
switch
withinstanceof
patterns) would be beneficial.The text was updated successfully, but these errors were encountered: