Spotless: [gradle-plugin]: Latest update (5.5.0) is broken on JDK loom eap builds

Created on 13 Sep 2020  路  2Comments  路  Source: diffplug/spotless

  • [x] summary of problem
    This commit is broken on JDK loom EAP builds (java.lang.StringIndexOutOfBoundsException). The plugin was working fine on all JDK eap versions, including project loom . The version format used is,
$ java -version    
openjdk version "16-loom" 2021-03-16
OpenJDK Runtime Environment (build 16-loom+6-105)
OpenJDK 64-Bit Server VM (build 16-loom+6-105, mixed mode, sharing)

Is it possible to handle the EAP version also?

  • [x] gradle or maven version

    • 6.7-rc-1

  • [x] spotless version

    • 5.5.0

  • [x] operating system and version

    • Mac OSX (10.13.6)

  • [x] copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
spotless {
    java {
        googleJavaFormat(Versions.googleJavaFormat)
    }
  kotlin {
        ktlint(Versions.ktlint).userData(mapOf("disabled_rules" to "no-wildcard-imports"))
        targetExclude("$buildDir/**/*.kt", "bin/**/*.kt")
        // licenseHeader(License.Apache)
    }
  kotlinGradle {
        ktlint(Versions.ktlint).userData(mapOf("disabled_rules" to "no-wildcard-imports"))
        target("*.gradle.kts")
    }
  format("misc") {
        target("**/*.md", "**/.gitignore")
        trimTrailingWhitespace()
        endWithNewline()
    }
 }
 ```
- [x] copy-paste the full content of any console errors emitted by `gradlew spotless[Apply/Check] --stacktrace`

Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 7
at com.diffplug.spotless.java.GoogleJavaFormatStep.(GoogleJavaFormatStep.java:84)
... 199 more
```

bug

Most helpful comment

Thanks for reporting. Fixed in plugin-gradle 5.5.1 and plugin-maven 2.3.1

All 2 comments

Ah, this should be easy to fix.

Thanks for reporting. Fixed in plugin-gradle 5.5.1 and plugin-maven 2.3.1

Was this page helpful?
0 / 5 - 0 ratings