palantir-java-format icon indicating copy to clipboard operation
palantir-java-format copied to clipboard

JDK21 string templates not works

Open GrapeBaBa opened this issue 1 year ago • 5 comments

What happened?

If the code contains string templates, spotlessApply will throw errors.

What did you want to happen?

should works fine.

GrapeBaBa avatar Dec 14 '23 06:12 GrapeBaBa

same problem

Screenshot 2024-01-18 210927

lost22git avatar Jan 18 '24 13:01 lost22git

Downstream reports - https://github.com/diffplug/spotless/issues/2046

tisonkun avatar Feb 17 '24 07:02 tisonkun

Duplicate of https://github.com/palantir/palantir-java-format/issues/930

bmarwell avatar Feb 18 '24 19:02 bmarwell

Duplicate of #930

Maybe not necessarily? Text blocks and string templates are separate features, although they can be used together.

For what it's worth, there were some recent changes to google-java-format to add initial support for string templates, it's possible that well be helpful for palanti-java-format (one, two, three)

cushon avatar Mar 02 '24 23:03 cushon

You are right. It is a preview feature in JDK 21, got me confused :)

bmarwell avatar Apr 21 '24 20:04 bmarwell

You are right. It is a preview feature in JDK 21, got me confused :)

And in JDK 23: Remove the String Templates preview feature: https://bugs.openjdk.org/browse/JDK-8329949

mhagnumdw avatar Jun 11 '24 17:06 mhagnumdw

Thanks guys.

GrapeBaBa avatar Jun 13 '24 00:06 GrapeBaBa