-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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:
Line 36 in 4885fa9
| val index = formatted.lastIndexOf("}") |
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.