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

google-java-format doesn't work in intellij idea,when i upgrad to jdk 21 with enable preview feature!~ #973

Open
coderhuang opened this issue Sep 22, 2023 · 5 comments
Labels

Comments

@coderhuang
Copy link

coderhuang commented Sep 22, 2023

My code use some preview feature, such as string template.
the code likes below

throw new IllegalArgumentException(STR."place:\{placeOrg.getName()},\{yearMonth}");

the error message is below

google-java-format failed. Does SchedulingAutomateFacade.java have syntax errors?

I worked with IntelliJ IDEA 2023.2.2

Does anyone can help me to solve this problem?
Thanks

@burl21
Copy link

burl21 commented Sep 22, 2023

Same for pattern matching

@duncanmak
Copy link

I mentioned a pattern matching failure here: #922 (comment)

@survivant
Copy link

When I read the title I tough you add the same issue that I have : https://youtrack.jetbrains.com/issue/IDEA-341425/JDK21-git-hook-Unrecognized-option-add-exports

@aneeshpadmanabhan
Copy link

I have the same issue with Intellij google-java-format plugin v1.20.0.0 . Is there a solution yet ?

The spotless maven plugin works fine using GJF v1.21.0

                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.43.0</version>
                <configuration>
                    <java>
                        <includes>
                            <include>src/main/java/**/*.java</include>
                            <include>src/test/java/**/*.java</include>
                        </includes>
                        <importOrder />
                        <removeUnusedImports />
                        <googleJavaFormat>
                            <version>1.21.0</version>
                            <style>GOOGLE</style>
                            <reflowLongStrings>true</reflowLongStrings>
                            <formatJavadoc>false</formatJavadoc>
                        </googleJavaFormat>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <id>spotless-check</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>`

@false9striker
Copy link

I am also facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants