rewrite-spring icon indicating copy to clipboard operation
rewrite-spring copied to clipboard

Whitespace not preserved when applying `SpringBoot2BestPractices` recipe

Open knutwannheden opened this issue 2 years ago • 1 comments

Playing with https://public.moderne.io/ I noticed that the "demo recipe" org.openrewrite.java.spring.boot2.SpringBoot2BestPractices doesn't preserve all whitespace in the affected sources and thus results in unexpected changes.

See this example for instance where in the BeanFactoryAwareFunctionRegistryMultiInOutTests.java source some whitespace between actual parameters is removed on line 316:

image

The same problem can be seen for formal parameters (whitespace after comma in parameter list is not preserved). I didn't analyze this any further, so the problem may not be related to this particular recipe.

knutwannheden avatar Dec 06 '22 07:12 knutwannheden

@traceyyoshima do you have any time to look into this?

tkvangorder avatar Dec 06 '22 16:12 tkvangorder