[JAVA-26720] Upgraded opencsv to 5.8 version (#15126)

This commit is contained in:
panos-kakos 2023-11-04 13:23:42 +00:00 committed by GitHub
parent 1baaca3e37
commit d9fd96773e
7 changed files with 10 additions and 7 deletions

View File

@ -56,7 +56,7 @@
<source.version>11</source.version>
<target.version>11</target.version>
<json.version>20200518</json.version>
<opencsv.version>4.1</opencsv.version>
<opencsv.version>5.8</opencsv.version>
</properties>
</project>

View File

@ -58,7 +58,7 @@
<properties>
<maven.compiler.source>11</maven.compiler.source>
<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>
<apache-commons-lang3.version>3.12.0</apache-commons-lang3.version>
<apache-commons-text.version>1.10.0</apache-commons-text.version>

View File

@ -12,6 +12,7 @@ import com.opencsv.CSVParser;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import com.opencsv.exceptions.CsvException;
public class SplitCommaSeparatedString {
@ -50,7 +51,7 @@ public class SplitCommaSeparatedString {
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(',')
.build();

View File

@ -14,6 +14,8 @@ import java.util.List;
import org.junit.Test;
import com.opencsv.exceptions.CsvException;
public class SplitCommaSeparatedStringUnitTest {
@Test
@ -27,7 +29,7 @@ public class SplitCommaSeparatedStringUnitTest {
}
@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()
+ "splitting,a,regular,line,no double quotes";

View File

@ -101,7 +101,7 @@
<snakeyaml.version>1.21</snakeyaml.version>
<kryo.version>4.0.1</kryo.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-sheets.version>v4-rev493-1.21.0</google-sheets.version>
<docx4j.version>6.1.2</docx4j.version>

View File

@ -59,7 +59,7 @@
<sshj.version>0.27.0</sshj.version>
<vfs.version>2.4</vfs.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.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -74,7 +74,7 @@
<properties>
<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>
<jaxb.version>4.0.2</jaxb.version>
<jackson-datatype.version>2.14.2</jackson-datatype.version>