Closed as not planned
Closed as not planned
Description
Hello,
As far as I know, there are two ways to apply google java style for Intellij
- Install google-java-format plugin and enable it
- Download google style xml file and import it into File→Settings→Editor→Code Style
I expected the same result, but the two methods seem to produce different results as follows,
-
Location of @Getter when @Getter put on a field
- Code reformatted with google-java-format plugin(1.13.0.0)
@Getter private final String value;
- Code reformatted with imported code style from xml file
@Getter private final String value;
-
Indent of @ApiImplicitParams({})
- Code reformatted with google-java-format plugin(1.13.0.0)
@ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "user name", dataTypeClass = String.class), })
- Code reformatted with imported code style from xml file
@ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "user name", dataTypeClass = String.class), })
-
Line wrapping when using stream
- Code reformatted with google-java-format plugin(1.13.0.0)
@RequiredArgsConstructor List<Integer> numbers = Arrays.asList(10, 2, 5, 32, 2, 5, 12, 34); List<Integer> results = numbers.stream() .map(number -> number * number) .filter(number -> number < 100) .collect(Collectors.toList());
- Code reformatted with imported code style from xml file
List<Integer> numbers = Arrays.asList(10, 2, 5, 32, 2, 5, 12, 34); List<Integer> results = numbers.stream() .map(number -> number * number) .filter(number -> number < 100) .collect(Collectors.toList());
Is it right that the results are different?
I think the reformat result by the plugin is consistent with the google java convention.
Why did the reformat result by xml file come out like this?
Any help would be much appreciated. Thanks :)
Metadata
Metadata
Assignees
Labels
No labels