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

Downgrading Spotless to pre-JDK16 versions breaks idempotency #1916

Closed
gmaltsev opened this issue Nov 29, 2023 · 1 comment
Closed

Downgrading Spotless to pre-JDK16 versions breaks idempotency #1916

gmaltsev opened this issue Nov 29, 2023 · 1 comment

Comments

@gmaltsev
Copy link

How to reproduce:

  1. Set up a project running Spotless 5.14.1 and JDK 17.
  2. Run ./gradlew clean spotlessApply.
  3. Get an exception described in this issue.
  4. Upgrade Spotless to 6.23.0.
  5. Run the command from step 2 again.
  6. Get no exception this time, as expected.
  7. Downgrade back to 5.14.1.
  8. Run the command from step 2 again.

Actual behaviour: the exception from step 3 is gone, build passes.

Expected behaviour: the same exception is back.

If you delete the ~/.gradle/daemon directory, it makes Spotless behave as expected again i.e. the exception is back.

This bug might create inconsistencies between local and CI environments if someone needs to downgrade Spotless for whatever reason.

Setup:
Gradle version: 8.4
Spotless version: 5.14.1
Operating system and version: Mac OS X 13.5.1 aarch64

Gradle config:

buildscript {
    ...
    dependencies {
        classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.14.1'
        ...
    }
}

...

sourceCompatibility = 17
targetCompatibility = 17

spotless {
    java {
        googleJavaFormat('1.18.1')
    }
}
@nedtwigg
Copy link
Member

nedtwigg commented Dec 4, 2023

5.14.1 was released 2021-07-06, there's no chance that we will publish a new patch release for 5.x. This is very interesting behavior, thank you for sharing it, but it's very unlikely that figuring this out will ever reach the top of our todo list.

@nedtwigg nedtwigg closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants