diff --git a/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java b/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java index 1517bdd76..0e8b502d3 100644 --- a/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java +++ b/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/diffs/ExtraWhiteSpaceCleaner.java @@ -30,7 +30,7 @@ public String clean(@Var String content, GitLineChange gitLineChange, Change cha .collect(Collectors.joining(lineEnding)); } } - if (endsWithLineEnding && !patch.getDeltas().isEmpty()) { + if (endsWithLineEnding && !patch.getDeltas().isEmpty() && !content.endsWith(lineEnding)) { content += lineEnding; } return content;