google-java-format
google-java-format copied to clipboard
Weird format in constructor with annotated args
Hello!
I'm working on a Spring Batch application using IntelliJ IDEA 2019.3.3 CE and I noticed a "weird" format using google-java-format 1.7.
Code before gjf:
@Autowired
public AllineamentoTasklet(
final @NonNull StoreRestRepository storeRepository,
final @NonNull AllineamentoService allineamentoService,
final @NonNull @Value("${allineamento-app.store-types}") List<String> storeTypes,
final @NonNull @Value("${allineamento-app.skippable-exceptions}") List<Class<? extends Exception>> skippableExceptions) {
..
..
}
// @NonNull is lombok's
Code after gjf:
@Autowired
public AllineamentoTasklet(
final @NonNull StoreRestRepository storeRepository,
final @NonNull AllineamentoService allineamentoService,
final @NonNull @Value("${allineamento-app.store-types}") List<String> storeTypes,
final @NonNull @Value("${allineamento-app.skippable-exceptions}") List<
Class<? extends Exception>>
skippableExceptions) {
..
..
}
Is this the expected result?
Thank you
Hello @alessandrococco
Did you try to change the version to google-java-format 1.8?
if the issue still exist try to add in labels IntelliJ IDEA 2019.3.3 CE
Thanks
Hello @bavly, thank you for your response!
Sorry but I cannot run google-java-format
1.8 because I'm still on java 8 and the latest google-java-format
needs java 11 :-(
You can install java 11 and specific the target source code as java 8. So you can use the features of this locally but deploy on java 8 servers