From c2875d3bd870af53b42f47be6bb26035973381c5 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 21 Jan 2010 05:36:46 +0000 Subject: [PATCH] only add a newline before the first new property rather than every new one git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@901537 13f79535-47bb-0310-9956-ffa450edef68 --- .../ant/util/LayoutPreservingProperties.java | 1 + .../optional/propertyfilelayout-test.xml | 116 ++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml diff --git a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java index 89a9c0859..6d29c7264 100644 --- a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java +++ b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java @@ -265,6 +265,7 @@ public class LayoutPreservingProperties extends Properties { if (((Pair)line).isNew()) { if (!writtenSep) { osw.write(LS); + writtenSep = true; } } osw.write(line.toString() + LS); diff --git a/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml b/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml new file mode 100644 index 000000000..c5fff7bfe --- /dev/null +++ b/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +