Skip to content

[2.9.2] Missing whitespace in curly brackets #882

@boris-petrov

Description

@boris-petrov

Congrats on the new release! I've got a few regressions though.

Prettier-Java 2.9.2

Playground link

# Options (if any):

Input:

public abstract class Foo {
  @SuppressWarnings({ "a", "b" })
  public Object foo() {
	return new String[] { "a", "b" };
  }
}

Output:

public abstract class Foo {

	@SuppressWarnings({"a", "b"})
	public Object foo() {
		return new String[] {"a", "b"};
	}
}

Expected behavior:

public abstract class Foo {

  @SuppressWarnings({ "a", "b" })
  public Object foo() {
	return new String[] { "a", "b" };
  }
}

This might be on purpose - if so - I don't think the new behavior is better/more readable. There isn't a direct comparison with JavaScript but object literals, which use {, do have a space around the curlies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions