Skip to content

Incompatibility when using enum-type framework and format-code #303

@tedberg

Description

@tedberg

In a project, using one of enum-type: framework or format-code: true works fine. When trying to use both of these together, generation fails with an exception during formatting.

The exception cause is a StringIndexOutOfBoundsException: Range [0, -1).

Looking into this it appears that the code here:

is assuming a class, but the exception stack trace shows that it is failing on the package-info.java file in the spring directory that was created. This is because the file doesn't contain braces, so the formatting fails.

I see that the generated api, model, support and validation packages do not contain a package-info.java file, which explains why formatting works for those packages. Only the spring package, which appears to only be created when using enum-type: framework has this file which breaks the formatter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions