Skip to content

Commit 6b02aa8

Browse files
committed
Revert "Only clone when text is not empty"
This reverts commit bfcb8e2.
1 parent 5c589b4 commit 6b02aa8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/io/fabric8/maven/MavenJDOMWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ protected void insertAtPreferredLocation(Element parent, Element child, Counter
266266
lastText = (Text) next;
267267
}
268268
}
269-
if ((lastText != null) && (!lastText.getTextTrim().isEmpty())) {
269+
if ((lastText != null) && (lastText.getTextTrim().isEmpty())) {
270270
lastText = lastText.clone();
271271
} else {
272272
lastText = factory.text(lineSeparator + indentation.repeat(counter.getDepth()));

src/test/java/io/fabric8/maven/MavenTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ void should_not_add_extra_line_break() throws Exception {
362362
Approvals.verify(sw.toString());
363363
}
364364

365-
@ValueSource(strings = { "extra-line-pom.xml", "extra-line-pom_alt.xml" })
365+
@ValueSource(strings = {"extra-line-pom.xml", "extra-line-pom_alt.xml"})
366366
@ParameterizedTest
367367
void should_not_add_extra_line_break_alt(String inputFile) throws Exception {
368368
Path pom = Paths.get(getClass().getResource(inputFile).toURI());

0 commit comments

Comments
 (0)