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

Spotless apply throws an error when running with JDK_17 #1210

Open
4 tasks done
abubkr-hago opened this issue Aug 15, 2024 · 1 comment · May be fixed by #1209
Open
4 tasks done

Spotless apply throws an error when running with JDK_17 #1210

abubkr-hago opened this issue Aug 15, 2024 · 1 comment · May be fixed by #1209
Labels
type:ci CI related issue

Comments

@abubkr-hago
Copy link

abubkr-hago commented Aug 15, 2024

New Issue Checklist

Issue Description

Spotless is formatting a lot of files not related to changes when applied before a commit.

Steps to reproduce

./gradlew spotlessApply

Expected Outcome

Applying code formatting rules to all project files successfully.

Actual Outcome

Step 'google-java-format' found problem in 'parse\src\main\java\com\parse\AbstractQueryController.java':
null
java.lang.reflect.InvocationTargetException
	at jdk.internal.reflect.GeneratedMethodAccessor519.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.diffplug.spotless.java.GoogleJavaFormatStep$State.lambda$createFormat$1(GoogleJavaFormatStep.java:176)
	at com.diffplug.spotless.FormatterFunc.apply(FormatterFunc.java:32)
	at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:78)
	at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:76)
	at com.diffplug.spotless.Formatter.compute(Formatter.java:230)
	at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:201)
	at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:188)
	at com.diffplug.gradle.spotless.SpotlessTaskImpl.processInputFile(SpotlessTaskImpl.java:71)
	at com.diffplug.gradle.spotless.SpotlessTaskImpl.performAction(SpotlessTaskImpl.java:57)
	at jdk.internal.reflect.GeneratedMethodAccessor468.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

...

Caused by: java.lang.IllegalAccessError: class com.google.googlejavaformat.java.JavaInput (in unnamed module @0x654fd887) cannot access class com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0x654fd887
	at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:349)
	at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:334)
	at com.google.googlejavaformat.java.JavaInput.<init>(JavaInput.java:276)
	at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:280)
	at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:267)
	at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:233)
	... 136 more
Copy link

parse-github-assistant bot commented Aug 15, 2024

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@abubkr-hago abubkr-hago linked a pull request Aug 15, 2024 that will close this issue
4 tasks
@abubkr-hago abubkr-hago changed the title Spotless is formatting a lot of files when applied Spotless apply throws an error when running with JDK_17 Aug 17, 2024
@mtrezza mtrezza added the type:ci CI related issue label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:ci CI related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants