Enclose system properties containing white space with quotation marks #1958
+50
−1
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.
Summary
Fixes #1904
For Surefire and Filesafe plugins with
<systemPropertyVariables />
containing properties with white space characters:U+0009
)U+000a
)U+000d
)U+0020
)wrap values with double quotation marks (
"
).Details
I chose these four characters as an intersection of a set of characters, supported by XML, and std::isspace() functions.
Command line reference for
java
command states in Standard options for java(emphasis mine)
that values with spaces must be enclosed, however in section Using the JDK_JAVA_OPTIONS Launcher Environment Variable it states:
and std::isspace() provides this list:
While 000 [C0 Controls and Basic Latin, C1 Controls and Latin-1 Supplement] section of XML Entity Definitions for Characters (3rd Edition) specifies, which Unicode characters with code points between
U+00000
andU+000FF
are valid XML entities.Manual testing if
java
preserves said whitespace when passed to it through command line with following test program:have shown following behavior on Fedora 41 and
OpenJDK Runtime Environment (Red_Hat-21.0.6.0.7-1) (build 21.0.6+7)
:and output: