Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter incorrect when using type parameters in records #443

Closed
victornoel opened this issue Sep 29, 2022 · 1 comment · Fixed by #444
Closed

Formatter incorrect when using type parameters in records #443

victornoel opened this issue Sep 29, 2022 · 1 comment · Fixed by #444

Comments

@victornoel
Copy link

Hi,

I am using:
Version: 2022-09 (4.25.0)
Build id: 20220908-1902

Starting with the following code (this would be the expected formatting after applying the formatter):

record MyRecord<A>() {}
class MyClass<A> extends AnotherClass {}

If I format using org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters do insert, notice the extra space between <A> and ():

record MyRecord<A> () {}
class MyClass<A> extends AnotherClass {}

And if I format using do not insert, notice the missing space between <A> and extends:

record MyRecord<A>() {}
class MyClass<A>extends AnotherClass {}
mateusz-matela added a commit to mateusz-matela/eclipse.jdt.core-dev that referenced this issue Oct 2, 2022
philwebb added a commit to spring-io/spring-javaformat that referenced this issue Feb 22, 2023
Change `insert_space_after_closing_angle_bracket_in_type_parameters`
back to `insert` to ensure generics are always formatted correctly.

This commit reverts commit b11499d as which we no longer need thanks
to eclipse-jdt/eclipse.jdt.core#443

Fixes gh-363
@PyvesB
Copy link
Contributor

PyvesB commented Apr 6, 2023

This issue was impacting my team, thanks for fixing @mateusz-matela!

robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this issue Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants