Skip to content

Commit 2c053a1

Browse files
Do trim to values in properties file
1 parent e714ecf commit 2c053a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ Properties loadPropertiesFile() throws IOException {
295295
FileInputStream fd = null;
296296
try {
297297
fd = new FileInputStream(propsFile);
298-
props.load(new InputStreamReader(fd, "UTF-8"));
298+
Properties rawProps = new Properties();
299+
rawProps.load(new InputStreamReader(fd, "UTF-8"));
300+
for (String str : rawProps.stringPropertyNames()) {
301+
props.setProperty(str, rawProps.getProperty(str).trim());
302+
}
299303
} finally {
300304
if (fd != null) {
301305
try {

0 commit comments

Comments
 (0)