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

Reformatting incorrectly concatenates decorator and decorated identifier in a generic extends clause #536

Closed
RadixSeven opened this issue May 18, 2022 · 2 comments · Fixed by #537
Labels
area: bug 🐛 Something isn't working $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/

Comments

@RadixSeven
Copy link

Prettier-Java 1.6.1

.prettierrc

{
  "proseWrap": "always"
}

Options:

--write

Input:

import org.jetbrains.annotations.NotNull;

public class Foo<T> {
    
  public <U extends @NotNull T> void example(U u) {}
}

Output:

import org.jetbrains.annotations.NotNull;

public class Foo<T> {

  public <U extends @NotNullT> void example(U u) {}
}

Expected behavior:
Should not delete the space in @NotNull T. The deletion changes the semantics.

Workaround

import org.jetbrains.annotations.NotNull;

public class Foo<T> {

  // @formatter:off
  public <U extends @NotNull T>
  // @formatter:on
  void example(U u) {}
}
@clementdessoude
Copy link
Contributor

Hi @RadixSeven ! Thanks for reporting this issue ! #537 should fix it !

@clementdessoude clementdessoude added the area: bug 🐛 Something isn't working label May 22, 2022
@pascalgrimaud pascalgrimaud added $100 https://www.jhipster.tech/bug-bounties/ $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ labels May 22, 2022
@pascalgrimaud
Copy link
Member

Adding a bounty as it's a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bug 🐛 Something isn't working $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants