import java.util.List;
import java.util.stream.Collectors;
public class Test {
public static final void main(String[] args) {
System.out.println(
List.of(1, 2, 3).stream().map(
// a very long comment which explains the beatifullness of multiplication by 2
// yes this is very important
v -> v * 2
).collect(Collectors.summingInt(v -> v))
);
}
}
Output:
import java.util.List;
import java.util.stream.Collectors;
public class Test {
public static final void main(String[] args) {
System.out.println(
List
.of(1, 2, 3)
.stream()
.map(v -> v * 2 // yes this is very important // a very long comment which explains the beatifullness of multiplication by 2
)
.collect(Collectors.summingInt(v -> v))
);
}
}
Expected behavior:
public class Test {
public static final void main(String[] args) {
System.out.println(
List
.of(1, 2, 3)
.stream()
.map(
// a very long comment which explains the beatifullness of multiplication by 2
// yes this is very important
v -> v * 2
)
.collect(Collectors.summingInt(v -> v))
);
}
}
Comments inside parenthesis blocks should remain unaltered like palantir-java-format seems to do.
Prettier-Java 2.1.0
used via spotless with the following config file
Input:
Output:
Expected behavior:
Comments inside parenthesis blocks should remain unaltered like palantir-java-format seems to do.