New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSVDataSet does not trim spaces in <filename>.csv #3420
Comments
Andrey Pokhilko (migrated from Bugzilla): |
Dzmitry Kashlach (migrated from Bugzilla): Created attachment bug_56877.patch: TestBeanHelper&GenericTestBeanCustomizer bug_56877.patchIndex: src/core/org/apache/jmeter/testbeans/TestBeanHelper.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/core/org/apache/jmeter/testbeans/TestBeanHelper.java (date 1388842110000)
+++ src/core/org/apache/jmeter/testbeans/TestBeanHelper.java (revision )
@@ -94,7 +94,7 @@
{
Method writeMethod = desc.getWriteMethod();
if (writeMethod!=null) {
- invokeOrBailOut(el, writeMethod, new Object[] {value});
+ invokeOrBailOut(el, writeMethod, new Object[] {value instanceof String?((String) value).trim():value});
}
}
}
Index: src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (date 1388842110000)
+++ src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (revision )
@@ -747,7 +747,7 @@
log.debug("Unset " + name);
}
} else {
- propertyMap.put(name, value);
+ propertyMap.put(name, value instanceof String?((String) value).trim():value);
if (log.isDebugEnabled()) {
log.debug("Set " + name + "= " + value);
} |
@pmouawad (migrated from Bugzilla): |
Dzmitry Kashlach (migrated from Bugzilla): |
Dzmitry Kashlach (migrated from Bugzilla): bug_56877.patchIndex: 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 (date 1388842110000)
+++ src/components/org/apache/jmeter/config/CSVDataSet.java (revision )
@@ -156,7 +156,7 @@
delim=",";
}
if (vars == null) {
- String _fileName = getFilename();
+ String _fileName = getFilename().trim();
String mode = getShareMode();
int modeInt = CSVDataSetBeanInfo.getShareModeAsInt(mode);
switch(modeInt){
Index: src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java (date 1388842110000)
+++ src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java (revision )
@@ -183,7 +183,7 @@
*/
@Override
public void setSourceFile(String source) {
- this.FILENAME = source;
+ this.FILENAME = source.trim();
}
/**
\ No newline at end of file |
@pmouawad (migrated from Bugzilla): To be clean, I think we should look at all elements that use FileNames and add trimming (not only to 2 elements). Also, for cleanness, I suggest setter are not modified, only the code that uses fileName should trim it. |
Dzmitry Kashlach (migrated from Bugzilla):
|
@pmouawad (migrated from Bugzilla): The best thing IMHO is to review all components that have filenames and trim spaces for them. It is more work but I think it is more coherent. |
Antonio Gomes Rodrigues (migrated from Bugzilla): I would like to know if you think it's need to be fixed? Because have spaces at the begin or/and at the end of a file is authorized (tested in Windows + Linux), I don't know what it needed to do Do you think the issue must be closed? If not, I will split it in separate issue and fix them one by one Antonio |
@pmouawad (migrated from Bugzilla): Regards |
Dzmitry Kashlach (Bug 56877):
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: csv_dataset.patch
csv_dataset.patch
OS: All
The text was updated successfully, but these errors were encountered: