Prettier-Java 2.7.3
Playground link
Input:
public abstract class Foo implements MyInterface {
@Override
public String foo() {
return left instanceof A
? right
: right instanceof B
? left
: left != null && right != null
? new C(left, right)
: null;
}
}
Output:
public abstract class Foo implements MyInterface {
@Override
public String foo() {
return left instanceof A
? right
: right instanceof B ? left : left != null && right != null ? new C(left, right) : null;
}
}
Expected behavior:
public abstract class Foo implements MyInterface {
@Override
public String foo() {
return left instanceof A
? right
: right instanceof B
? left
: left != null && right != null
? new C(left, right)
: null;
}
}
Which is what Prettier for JavaScript does.
Prettier-Java 2.7.3
Playground link
Input:
Output:
Expected behavior:
Which is what Prettier for JavaScript does.