Skip to content

Formatting java record with generics adds a whitespace before a bracket #348

Closed
@andrej-urvantsev

Description

@andrej-urvantsev

Spring format adds a white space between > and (:

private record LookupResult<T> (T match, boolean hasMore) {
	}

And then checkstyle fails with

'(' is preceded with whitespace.

Activity

added this to the 0.0.x milestone on Dec 2, 2022
wilkinsona

wilkinsona commented on Jan 18, 2023

@wilkinsona
Contributor

This behavior is controlled by org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters. To avoid adding the whitespace we should set it to do not insert.

modified the milestones: 0.0.x, 0.0.36 on Jan 20, 2023
self-assigned this
on Feb 17, 2023
added a commit that references this issue on Feb 6, 2024
b11499d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @philwebb@wilkinsona@andrej-urvantsev

      Issue actions

        Formatting java record with generics adds a whitespace before a bracket · Issue #348 · spring-io/spring-javaformat