[JAVA-26720] Upgraded opencsv to 5.8 version (#15126)
This commit is contained in:
parent
1baaca3e37
commit
d9fd96773e
@ -56,7 +56,7 @@
|
|||||||
<source.version>11</source.version>
|
<source.version>11</source.version>
|
||||||
<target.version>11</target.version>
|
<target.version>11</target.version>
|
||||||
<json.version>20200518</json.version>
|
<json.version>20200518</json.version>
|
||||||
<opencsv.version>4.1</opencsv.version>
|
<opencsv.version>5.8</opencsv.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -58,7 +58,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>11</maven.compiler.source>
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
<maven.compiler.target>11</maven.compiler.target>
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
<opencsv.version>4.1</opencsv.version>
|
<opencsv.version>5.8</opencsv.version>
|
||||||
<spring-core.version>5.3.13</spring-core.version>
|
<spring-core.version>5.3.13</spring-core.version>
|
||||||
<apache-commons-lang3.version>3.12.0</apache-commons-lang3.version>
|
<apache-commons-lang3.version>3.12.0</apache-commons-lang3.version>
|
||||||
<apache-commons-text.version>1.10.0</apache-commons-text.version>
|
<apache-commons-text.version>1.10.0</apache-commons-text.version>
|
||||||
|
@ -12,6 +12,7 @@ import com.opencsv.CSVParser;
|
|||||||
import com.opencsv.CSVParserBuilder;
|
import com.opencsv.CSVParserBuilder;
|
||||||
import com.opencsv.CSVReader;
|
import com.opencsv.CSVReader;
|
||||||
import com.opencsv.CSVReaderBuilder;
|
import com.opencsv.CSVReaderBuilder;
|
||||||
|
import com.opencsv.exceptions.CsvException;
|
||||||
|
|
||||||
public class SplitCommaSeparatedString {
|
public class SplitCommaSeparatedString {
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ public class SplitCommaSeparatedString {
|
|||||||
return splitter.splitToList(input);
|
return splitter.splitToList(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<String[]> splitMultiLineWithOpenCSV(String input) throws IOException {
|
public static List<String[]> splitMultiLineWithOpenCSV(String input) throws IOException, CsvException {
|
||||||
CSVParser parser = new CSVParserBuilder().withSeparator(',')
|
CSVParser parser = new CSVParserBuilder().withSeparator(',')
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.opencsv.exceptions.CsvException;
|
||||||
|
|
||||||
public class SplitCommaSeparatedStringUnitTest {
|
public class SplitCommaSeparatedStringUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -27,7 +29,7 @@ public class SplitCommaSeparatedStringUnitTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenMultiLineInput_whenParsing_shouldIgnoreCommasInsideDoubleQuotes() throws IOException {
|
public void givenMultiLineInput_whenParsing_shouldIgnoreCommasInsideDoubleQuotes() throws IOException, CsvException {
|
||||||
String input = "baeldung,tutorial,splitting,text,\"ignoring this comma,\"" + System.lineSeparator()
|
String input = "baeldung,tutorial,splitting,text,\"ignoring this comma,\"" + System.lineSeparator()
|
||||||
+ "splitting,a,regular,line,no double quotes";
|
+ "splitting,a,regular,line,no double quotes";
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@
|
|||||||
<snakeyaml.version>1.21</snakeyaml.version>
|
<snakeyaml.version>1.21</snakeyaml.version>
|
||||||
<kryo.version>4.0.1</kryo.version>
|
<kryo.version>4.0.1</kryo.version>
|
||||||
<smooks.version>1.7.0</smooks.version>
|
<smooks.version>1.7.0</smooks.version>
|
||||||
<opencsv.version>4.1</opencsv.version>
|
<opencsv.version>5.8</opencsv.version>
|
||||||
<google-api.version>1.23.0</google-api.version>
|
<google-api.version>1.23.0</google-api.version>
|
||||||
<google-sheets.version>v4-rev493-1.21.0</google-sheets.version>
|
<google-sheets.version>v4-rev493-1.21.0</google-sheets.version>
|
||||||
<docx4j.version>6.1.2</docx4j.version>
|
<docx4j.version>6.1.2</docx4j.version>
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
<sshj.version>0.27.0</sshj.version>
|
<sshj.version>0.27.0</sshj.version>
|
||||||
<vfs.version>2.4</vfs.version>
|
<vfs.version>2.4</vfs.version>
|
||||||
<zip4j.version>2.9.0</zip4j.version>
|
<zip4j.version>2.9.0</zip4j.version>
|
||||||
<opencsv.version>5.7.1</opencsv.version>
|
<opencsv.version>5.8</opencsv.version>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<spring.version>6.0.6</spring.version>
|
<spring.version>6.0.6</spring.version>
|
||||||
<opencsv.version>5.7.1</opencsv.version>
|
<opencsv.version>5.8</opencsv.version>
|
||||||
<jakarta.xml.bind-api>4.0.0</jakarta.xml.bind-api>
|
<jakarta.xml.bind-api>4.0.0</jakarta.xml.bind-api>
|
||||||
<jaxb.version>4.0.2</jaxb.version>
|
<jaxb.version>4.0.2</jaxb.version>
|
||||||
<jackson-datatype.version>2.14.2</jackson-datatype.version>
|
<jackson-datatype.version>2.14.2</jackson-datatype.version>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user