Cleanup for Codacy and better parsing of quote character
This commit is contained in:
parent
a89bbcbbe2
commit
f5ff5565ff
@ -103,8 +103,8 @@ public class SeparatorBasedImporter extends TabularImportingParserBase {
|
||||
|
||||
Character quote = CSVParser.DEFAULT_QUOTE_CHARACTER;
|
||||
String quoteCharacter = JSONUtilities.getString(options, "quoteCharacter", null);
|
||||
if (!StringUtils.isBlank(quoteCharacter)) {
|
||||
quote = quoteCharacter.charAt(0);
|
||||
if (quoteCharacter != null && quoteCharacter.trim().length() == 1) {
|
||||
quote = quoteCharacter.trim().charAt(0);
|
||||
}
|
||||
|
||||
final CSVParser parser = new CSVParser(
|
||||
|
@ -489,7 +489,7 @@ public class TsvCsvImporterTests extends ImporterTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "CSV-TSV-AutoDetermine")
|
||||
public void readSimpleData_CSV_1Header_1Row_singleQuote(String sep){
|
||||
public void customQuoteCharacter(String sep){
|
||||
//create input to test with
|
||||
String inputSeparator = sep == null ? "\t" : sep;
|
||||
String input = "'col1'" + inputSeparator + "'col2'" + inputSeparator + "'col3'\n" +
|
||||
|
Loading…
Reference in New Issue
Block a user