Bug 61827 - TextFile always adds newline to end of string #346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Re-wrote
getText
(andsetText
while I was there) forTextFile
becausegetText
always appends a newline separator at the end of the file regardless if the original file has one or not.This changes the behaviour slightly and currently breaks some tests. I'm not sure if it's the tests' fault or the change. I've "fixed" the tests, but these need reviewing by someone who knows how the JMS stuff and anything else which uses it works and any assumptions they made. It also returned the new lines of the file not the system new lines.
Motivation and Context
https://bz.apache.org/bugzilla/show_bug.cgi?id=61827
How Has This Been Tested?
Added unit tests to demo the new behaviour, previous code would have failed by adding an extra newline to end of file which did not end in a new line.
Screenshots (if appropriate):
Types of changes
Checklist: