Commit 06a8c419 authored by Andy Wilkinson's avatar Andy Wilkinson

Preserve trailing whitespace in origin-tracked property values

Closes gh-13602
parent 032d5488
......@@ -135,7 +135,7 @@ class OriginTrackedPropertiesLoader {
reader.read();
}
Origin origin = new TextResourceOrigin(this.resource, location);
return OriginTrackedValue.of(buffer.toString().trim(), origin);
return OriginTrackedValue.of(buffer.toString(), origin);
}
/**
......
......@@ -248,6 +248,12 @@ public class OriginTrackedPropertiesLoaderTests {
assertThat(getValue(value)).isEqualTo("æ×ÈÅÞßáñÀÿ");
}
@Test
public void getPropertyWithTrailingSpace() {
OriginTrackedValue value = this.properties.get("test-with-trailing-space");
assertThat(getValue(value)).isEqualTo("trailing ");
}
private Object getValue(OriginTrackedValue value) {
return (value != null ? value.getValue() : null);
}
......
......@@ -40,3 +40,5 @@ test-multiline-immediate-bang=\
#test ISO 8859-1
test-iso8859-1-chars=
test-with-trailing-space= trailing
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment