apache / apache/jmeter

CSVDataSet does not trim spaces in <filename>.csv

Open
#3,420 10 comments 0 reactions 0 assignees View on GitHub
enhancement keyword: PatchAvailable os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Dzmitry Kashlach** ([Bug 56877](https://bz.apache.org/bugzilla//show_bug.cgi?id=56877&redirect=false)):
CSVDataSet does not trim spaces in <filename>.csv
E.g. if user entered in text-box "<filename>.csv ", then filename will be set as
"<filename>.csv " but not "<filename>.csv".
I suggest simple patch for it.

Created attachment [csv_dataset.patch](https://apache.github.io/jmeter-bugzilla-attachments/77/56877/31936/csv_dataset.patch): csv_dataset.patch
csv_dataset.patch

````diff
Index: src/components/org/apache/jmeter/config/CSVDataSet.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/components/org/apache/jmeter/config/CSVDataSet.java (revision 25897c69d454701793f8506bb7680bb115190eb2)
+++ src/components/org/apache/jmeter/config/CSVDataSet.java (revision )
@@ -226,7 +226,7 @@
* The filename to set.
*/
public void setFilename(String filename) {
- this.filename = filename;
+ this.filename = filename.trim();
}

/**
````

OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.