Skip to content

java.lang.IllegalArgumentException: Could not parse as Java #428

@koppor

Description

@koppor

I am trying to reproduce an issue. Thereby, I am running JUnit5BestPractices on the codebase without any other recipe.

I get

All sources parsed, running active recipes: org.jabref.config.rewrite.cleanup
The recipe produced an error. Please report this to the recipe author.

> Task :rewriteRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rewriteRun'.
> java.lang.RuntimeException: Error while visiting src\test\java\org\jabref\gui\externalfiles\FileFilterUtilsTest.java: java.lang.IllegalArgumentException: Could not parse as Java
    org.openrewrite.java.internal.template.JavaTemplateParser.lambda$compileTemplate$11(JavaTemplateParser.java:245)
    java.base/java.util.Optional.orElseThrow(Optional.java:403)
    org.openrewrite.java.internal.template.JavaTemplateParser.compileTemplate(JavaTemplateParser.java:245)

Deep link to failing file: https://github.com/koppor/jabref/blob/675fcf7a56c0159a0c48c62e1723bff1d9b29c73/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java#L21

  • gradle
  • id 'org.openrewrite.rewrite' version '6.5.4'
  • rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.5.0"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions