< prev index next >
test/jdk/java/lang/String/AlignIndent.java
Print this page
rev 53050 : 8215493: String::indent inconsistency with blank lines
Reviewed-by: rriggs, smarks
@@ -137,11 +137,11 @@
String output = input.indent(adjust);
Stream<String> stream = input.lines();
if (adjust > 0) {
final String spaces = " ".repeat(adjust);
- stream = stream.map(s -> s.isBlank() ? s : spaces + s);
+ stream = stream.map(s -> spaces + s);
} else if (adjust < 0) {
stream = stream.map(s -> s.substring(Math.min(-adjust, indexOfNonWhitespace(s))));
}
String expected = stream.collect(Collectors.joining("\n", "", "\n"));
< prev index next >