Skip to content

Commit aa5b3bc

Browse files
committed
Merge ../commons-csv-fork-apache-branch-cf into csv190
2 parents 73c9134 + fc67b43 commit aa5b3bc

85 files changed

Lines changed: 5517 additions & 2973 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
version: 2
17+
updates:
18+
- package-ecosystem: "maven"
19+
directory: "/"
20+
schedule:
21+
interval: "daily"
22+
- package-ecosystem: "github-actions"
23+
directory: "/"
24+
schedule:
25+
interval: "daily"

.github/workflows/maven.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,33 @@
1515

1616
name: Java CI
1717

18-
on: [push]
18+
on: [push, pull_request]
1919

2020
jobs:
2121
build:
2222

2323
runs-on: ubuntu-latest
24+
continue-on-error: ${{ matrix.experimental }}
2425
strategy:
2526
matrix:
26-
java: [ 8 ]
27+
java: [ 8, 11, 16 ]
28+
experimental: [false]
29+
include:
30+
- java: 17-ea
31+
experimental: true
2732

2833
steps:
29-
- uses: actions/checkout@v1
34+
- uses: actions/checkout@v2.3.4
35+
- uses: actions/cache@v2.1.6
36+
with:
37+
path: ~/.m2/repository
38+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
39+
restore-keys: |
40+
${{ runner.os }}-maven-
3041
- name: Set up JDK ${{ matrix.java }}
31-
uses: actions/setup-java@v1
42+
uses: actions/setup-java@v2
3243
with:
44+
distribution: 'adopt'
3345
java-version: ${{ matrix.java }}
3446
- name: Build with Maven
35-
run: mvn -V -Dmaven.test.skip=true package --file pom.xml
47+
run: mvn -Dmaven.test.skip=true package --file pom.xml --no-transfer-progress

.gitignore

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1-
### https://raw.github.com/github/gitignore/14b7566ce157ce95b07006466bacee160f242284/maven.gitignore
1+
### https://github.com/github/gitignore/blob/master/Maven.gitignore
2+
3+
cfMavenCentral.xml.asc
24

35
target/
46
pom.xml.tag
57
pom.xml.releaseBackup
68
pom.xml.versionsBackup
79
pom.xml.next
810
release.properties
11+
dependency-reduced-pom.xml
12+
buildNumber.properties
13+
.mvn/timing.properties
14+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
15+
.mvn/wrapper/maven-wrapper.jar
916

17+
.classpath
18+
.project
19+
.settings/
1020

11-
/.classpath
12-
/.project
13-
/.settings/
21+
/.idea/
22+
*.iml
1423

15-
cfMavenCentral.xml.asc
24+
/.vscode/

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515

1616
language: java
1717

18-
jdk:
19-
# - oraclejdk11
20-
- openjdk8
21-
# - openjdk11
22-
# - openjdk12
23-
# - openjdk13
24-
# - openjdk-ea
18+
matrix:
19+
include:
20+
- jdk: openjdk8
21+
- jdk: openjdk11
22+
- jdk: openjdk16
23+
- jdk: openjdk-ea
24+
allow_failures:
25+
- jdk: openjdk-ea
2526

2627
install: true
2728

2829
script:
2930
- mvn -B -Dmaven.test.skip=true package
3031

3132
after_success:
32-
- mvn -B -V clean test jacoco:report coveralls:report -Ptravis-jacoco
33-
33+
- mvn -B -V clean test jacoco:report coveralls:report -Ptravis-jacoco --no-transfer-progress

BENCHMARK.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!---
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
Apache Commons CSV Benchmark
19+
===================
20+
21+
Apache Commons CSV includes a Java Microbenchmark Harness (JMH) for testing various implementations
22+
of CSV processing.
23+
24+
Prerequisite
25+
-------------
26+
27+
The Skife CSV implementation is not available in Maven Central and therefore must be manually
28+
installed into the local Maven repository. Run the falling script to download and install
29+
the JAR file (~1MB).
30+
31+
```shell
32+
./benchmark-prereq.sh
33+
```
34+
35+
Benchmarks
36+
-------------
37+
38+
Benchmark Name | CSV Parser | Description
39+
--------------- | --------------- | -------------
40+
read | Java JDK | Use BufferedReader to perform a line count
41+
scan | Java JDK | Use Scanner to perform a line count
42+
split | Java JDK | Use BufferedReader to split each line on a delimiter
43+
parseCommonsCSV | commons-csv | Use CSVFormat to split each line on a delimiter
44+
parseGenJavaCSV | generation-java | Use CsvReader to split each line on a delimiter
45+
parseJavaCSV | java-csv | Use CsvReader to split each line on a delimiter
46+
parseOpenCSV | open-csv | Use CSVReader to split each line on a delimiter
47+
parseSkifeCSV | skife-csv | Use CSVReader to split each line on a delimiter
48+
parseSuperCSV | super-csv | Use CsvListReader to split each line on a delimiter
49+
50+
Running the Tests
51+
-------------
52+
53+
```shell
54+
# Run all benchmark tests
55+
mvn test -Pbenchmark
56+
57+
# Run a specific benchmark test
58+
mvn test -Pbenchmark -Dbenchmark=<name>
59+
60+
# Example of running basic "read" benchmark
61+
mvn test -Pbenchmark -Dbenchmark=read
62+
```
63+
64+
Performance Test
65+
-------------
66+
67+
Apache Commons CSV includes a stand-alone performance test which only covers commons-csv.
68+
69+
```shell
70+
# Run the performance test
71+
mvn test -Dtest=PerformanceTest
72+
```
73+
74+
> :warning: This performance test does not use JMH; it uses simple timing metrics.
75+
76+
Performance Test Harness
77+
-------------
78+
79+
CSV offers a secondary performance test harness located at: `org.apache.commons.csv.PerformanceTest`

CODE_OF_CONDUCT.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!---
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
The Apache code of conduct page is [https://www.apache.org/foundation/policies/conduct.html](https://www.apache.org/foundation/policies/conduct.html).

NOTICE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Apache Commons CSV
2-
Copyright 2005-2020 The Apache Software Foundation
2+
Copyright 2005-2021 The Apache Software Foundation
33

44
This product includes software developed at
55
The Apache Software Foundation (https://www.apache.org/).

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@
4343
Apache Commons CSV
4444
===================
4545

46-
[![Build Status](https://travis-ci.org/apache/commons-csv.svg)](https://travis-ci.org/apache/commons-csv)
46+
[![Travis-CI Status](https://travis-ci.org/apache/commons-csv.svg)](https://travis-ci.org/apache/commons-csv)
47+
[![GitHub Actions Status](https://github.com/apache/commons-csv/workflows/Java%20CI/badge.svg)](https://github.com/apache/commons-csv/actions)
4748
[![Coverage Status](https://coveralls.io/repos/apache/commons-csv/badge.svg)](https://coveralls.io/r/apache/commons-csv)
4849
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-csv/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-csv/)
49-
[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-csv/1.8.svg)](https://javadoc.io/doc/org.apache.commons/commons-csv/1.8)
50+
[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-csv/1.9.0.svg)](https://javadoc.io/doc/org.apache.commons/commons-csv/1.9.0)
5051

5152
The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types.
5253

@@ -67,7 +68,7 @@ Alternatively you can pull it from the central Maven repositories:
6768
<dependency>
6869
<groupId>org.apache.commons</groupId>
6970
<artifactId>commons-csv</artifactId>
70-
<version>1.8</version>
71+
<version>1.9.0</version>
7172
</dependency>
7273
```
7374

RELEASE-NOTES.txt

Lines changed: 108 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,122 @@
11
Apache Commons CSV
2-
Version 1.8
2+
Version 1.9.0
33
Release Notes
44

55

66
INTRODUCTION:
77

8-
This document contains the release notes for the 1.8-SNAPSHOT version of Apache Commons CSV.
8+
This document contains the release notes for the 1.9.0 version of Apache Commons CSV.
99
Commons CSV reads and writes files in variations of the Comma Separated Value (CSV) format.
1010

11-
Commons CSV requires at least Java 6.
11+
Commons CSV requires at least Java 8.
1212

1313
The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types.
1414

15-
Feature and bug fix release (Java 8).
15+
Feature and bug fix release (Java 8)
16+
17+
Changes in this version include:
18+
19+
NEW FEATURES
20+
============
21+
22+
o CSV-275: Make CSVRecord#toList() public. Thanks to Michael Wyraz, Gary Gregory.
23+
o Add CSVRecord#stream(). Thanks to Gary Gregory.
24+
o Add CSVParser#stream(). Thanks to Gary Gregory.
25+
o CSV-184: Make the method CSVRecord.putIn(Map) public. Thanks to Gaurav Agarwal, M. Steiger, Gary Gregory.
26+
o Add test cases for CSVRecord with get(Enum) and toString. #54. Thanks to dota17.
27+
o Add and use CSVFormat.Builder, deprecated CSVFormat#with methods, based on #73. Thanks to Gary Gregory, dota17.
28+
o CSV-206: Add support for String delimiters #76. Thanks to Gary Gregory, dota17.
29+
30+
FIXED BUGS
31+
==========
32+
33+
o Replace FindBugs with SpotBugs #56. Thanks to Amey Jadiye.
34+
o Javadoc typo in CSVFormat let's -> lets #57. Thanks to Chen.
35+
o CSV-259: CSVFormat.printWithEscapes throws StringIndexOutOfBoundsException when value is Reader #61. Thanks to Chen.
36+
o Improve CSVFormat test coverage #63. Thanks to Chen.
37+
o Fix CSVFileParserTest.java to allow for a null return value from record.getComment() #62. Thanks to Chen.
38+
o Improve test coverage in CSVFormatTest #65. Thanks to Chen.
39+
o Removed invalid Javadoc markup for CSVFormat EXCEL #64. Thanks to Chen.
40+
o Improve CSVRecord and CSVPrinter code coverage #66. Thanks to Chen.
41+
o Improve lexer and token coverage #67. Thanks to Chen.
42+
o CSV-211: CSVFormat.format trims last delimiter if the delimiter is a white space #71. Thanks to Alpesh Kulkarni, Chen.
43+
o Replace org.apache.commons.csv.Assertions.notNull() with Objects.requireNonNull(). Thanks to Gary Gregory.
44+
o CSV-149: Line number is not proper at EOF. Thanks to Kranthi, Gary Gregory, Brent Worden, dota17.
45+
o CSV-195: Parser iterates over the last CSV Record twice. Thanks to Rodolfo Duldulao, Rodolfo Duldulao, Michael Vitz, dota17.
46+
o CSV-267: Minor improvements #126, #127, #130. Thanks to Arturo Bernal.
47+
o CSV-123: Add possibility to use ResultSet header meta data as CSV header #11. Thanks to Emmanuel Bourg, Benedikt Ritter, shivakrishnaah, Gary Gregory.
48+
o CSV-148: Add test cases for withIgnoreSurroundingSpaces() and withTrim() #70. Thanks to dota17.
49+
o Update CSVParser.parse(File, Charset, CSVFormat) from IO to NIO. Thanks to Gary Gregory.
50+
o CSV-271: Missing separator with print(object) followed by printRecord(Object[]) #157. Thanks to Amar Prakash Pandey.
51+
o CSV-158: Fix EOL checking for read array in ExtendedBufferedReader #5. Thanks to Alexander Bondarev, Benedikt Ritter, Gary Gregory, Chen.
52+
o CSV-263: Print from Reader with embedded quotes generates incorrect output #78. Thanks to Jason A. Guild, Gary Gregory.
53+
o Replace JUnit assert by simpler but equivalent calls. #159. Thanks to Arturo Bernal.
54+
o Update gitignore to ignore idea and vscode #160. Thanks to Seth Falco.
55+
o CSV-281: Update CSVBenchmark #165. Thanks to belugabehr.
56+
o CSV-283: Remove Whitespace Check Determines Delimiter Twice #167. Thanks to belugabehr.
57+
o CSV-283: Document and Automate CSV Benchmark Harness #166. Thanks to belugabehr.
58+
o CSV-279: Optimize Lexer Delimiter Check for One Character Delimiter #163. Thanks to belugabehr.
59+
o SpotBugs Error: Medium: org.apache.commons.csv.CSVParser.getHeaderNames() may expose internal representation by returning CSVParser.headerNames [org.apache.commons.csv.CSVParser] At CSVParser.java:[line 599] EI_EXPOSE_REP. Thanks to Gary Gregory.
60+
o SpotBugs Error: Medium: new org.apache.commons.csv.CSVParser(Reader, CSVFormat, long, long) may expose internal representation by storing an externally mutable object into CSVParser.format [org.apache.commons.csv.CSVParser] At CSVParser.java:[line 433] EI_EXPOSE_REP2. Thanks to Gary Gregory.
61+
o SpotBugs Error: Medium: new org.apache.commons.csv.CSVParser(Reader, CSVFormat, long, long) may expose internal representation by storing an externally mutable object into CSVParser.headerMap [org.apache.commons.csv.CSVParser] At CSVParser.java:[line 437] EI_EXPOSE_REP2. Thanks to Gary Gregory.
62+
o SpotBugs Error: Medium: new org.apache.commons.csv.CSVParser(Reader, CSVFormat, long, long) may expose internal representation by storing an externally mutable object into CSVParser.headerNames [org.apache.commons.csv.CSVParser] At CSVParser.java:[line 438] EI_EXPOSE_REP2. Thanks to Gary Gregory.
63+
o SpotBugs Error: Medium: new org.apache.commons.csv.CSVPrinter(Appendable, CSVFormat) may expose internal representation by storing an externally mutable object into CSVPrinter.format [org.apache.commons.csv.CSVPrinter] At CSVPrinter.java:[line 100] EI_EXPOSE_REP2. Thanks to Gary Gregory.
64+
o CSV-284: Formalize PerformanceTest #168. Thanks to belugabehr.
65+
o CSV-278: Reuse Buffers in Lexer for Delimiter Detection #162. Thanks to belugabehr.
66+
o CSV-286: Cleanup and Document Performance Test Harness #170. Thanks to belugabehr.
67+
o CSV-265: Update buffer position when reading line comment #120. Thanks to belugabehr.
68+
69+
CHANGES
70+
=======
71+
72+
o Update org.junit.jupiter:junit-jupiter from 5.6.0 to 5.7.0, #84 #109 Thanks to Gary Gregory.
73+
o Update tests from Apache Commons Lang 3.9 to 3.12.0. Thanks to Gary Gregory.
74+
o Update tests from commons-io:commons-io 2.6 to 2.11.0, #108. Thanks to Gary Gregory.
75+
o Bump actions/checkout from v1 to v2.3.4, #79, #92, #121. Thanks to Dependabot.
76+
o Bump commons-parent from 50 to 51 #80. Thanks to Dependabot.
77+
o Bump tests from opencsv from 3.1 to 5.5.1 #81, #137, #158. Thanks to Dependabot, Gary Gregory.
78+
o Update tests from super-csv from 2.2.1 to 2.4.0 #86. Thanks to Gary Gregory.
79+
o Bump build actions/setup-java from v1.4.0 to v2, #101, #113. Thanks to Dependabot, Gary Gregory.
80+
o Bump maven-pmd-plugin from 3.13.0 to 3.14.0 #122. Thanks to Dependabot.
81+
o Bump tests from org.mockito:mockito-core 3.2.4 -> 3.11.2; #88, #107, #110, #123, #128, #129, #156. Thanks to Gary Gregory, Dependabot.
82+
o Bump actions/cache from v2 to v2.1.6 #132, #153. Thanks to Dependabot.
83+
o Bump maven-checkstyle-plugin from 3.0.0 to 3.1.2 #131. Thanks to Gary Gregory, Dependabot.
84+
o Bump checkstyle from 8.29 to 8.44. Thanks to Gary Gregory.
85+
o Bump junit-jupiter from 5.7.0 to 5.8.0-M1 #133, #149. Thanks to Dependabot, Gary Gregory.
86+
o Bump commons.jacoco.version from 0.8.5 to 0.8.7 (Java 16). Thanks to Dependabot.
87+
o Bump commons.spotbugs.version from 4.0.4 to 4.3.0 (Java 16). Thanks to Dependabot.
88+
o Bump maven-javadoc-plugin from 3.2.0 to 3.3.0. Thanks to Gary Gregory.
89+
o Bump jmh-generator-annprocess from 1.5.2 to 1.32 #151. Thanks to Dependabot.
90+
o Bump PMD core from 6.29.0 to 6.36.0. Thanks to Dependabot.
91+
o Bump biz.aQute.bnd:biz.aQute.bndlib from 5.1.2 to 5.3.0. Thanks to Dependabot.
92+
93+
94+
Historical list of changes: https://commons.apache.org/proper/commons-csv/changes-report.html
95+
96+
For complete information on Apache Commons CSV, including instructions on how to submit bug reports,
97+
patches, or suggestions for improvement, see the Apache Apache Commons CSV website:
98+
99+
https://commons.apache.org/proper/commons-csv/
100+
101+
Download page: https://commons.apache.org/proper/commons-csv/download_csv.cgi
102+
103+
Have fun!
104+
-Apache Commons CSV team
105+
106+
------------------------------------------------------------------------------
107+
108+
Apache Commons CSV
109+
Version 1.8
110+
Release Notes
111+
112+
113+
INTRODUCTION:
114+
115+
This document contains the release notes for the 1.8 version of Apache Commons CSV.
116+
Commons CSV reads and writes files in variations of the Comma Separated Value (CSV) format.
117+
118+
Commons CSV requires at least Java 8.
119+
16120
This release fixes serialization compatibility of CSVRecord with versions 1.0 to 1.6. New fields added since
17121
1.7 are not serialized. Support for Serializable is scheduled to be removed in version 2.0.
18122

SECURITY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!---
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
The Apache Commons security page is [https://commons.apache.org/security.html](https://commons.apache.org/security.html).

0 commit comments

Comments
 (0)