Skip to content

Commit 110fea8

Browse files
authored
Merge branch 'apache:master' into CSV-196-master
2 parents bdd152f + af2c3f8 commit 110fea8

Some content is hidden

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

58 files changed

+1197
-1060
lines changed

.github/pull_request_template.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
Thanks for your contribution to [Apache Commons](https://commons.apache.org/)! Your help is appreciated!
21+
22+
Before you push a pull request, review this list:
23+
24+
- [ ] Read the [contribution guidelines](CONTRIBUTING.md) for this project.
25+
- [ ] Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself.
26+
- [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice.
27+
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
28+
- [ ] Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge.

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
4949
with:
5050
persist-credentials: false
51-
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
51+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5252
with:
5353
path: ~/.m2/repository
5454
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -57,7 +57,7 @@ jobs:
5757
5858
# Initializes the CodeQL tools for scanning.
5959
- name: Initialize CodeQL
60-
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0
60+
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # 3.28.0
6161
with:
6262
languages: ${{ matrix.language }}
6363
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,7 @@ jobs:
6868
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6969
# If this step fails, then you should remove it and run the build manually (see below)
7070
- name: Autobuild
71-
uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0
71+
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # 3.28.0
7272

7373
# ℹ️ Command-line programs to run using the OS shell.
7474
# 📚 https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
8282
# make release
8383

8484
- name: Perform CodeQL Analysis
85-
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0
85+
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # 3.28.0

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
- name: 'Checkout Repository'
2929
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030
- name: 'Dependency Review PR'
31-
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
31+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ jobs:
3737
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
3838
with:
3939
persist-credentials: false
40-
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
40+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
4141
with:
4242
path: ~/.m2/repository
4343
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
4444
restore-keys: |
4545
${{ runner.os }}-maven-
4646
- name: Set up JDK ${{ matrix.java }}
47-
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
47+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
4848
with:
4949
distribution: 'temurin'
5050
java-version: ${{ matrix.java }}

.github/workflows/scorecards-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ jobs:
5757
publish_results: true
5858

5959
- name: "Upload artifact"
60-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # 4.4.3
60+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # 4.5.0
6161
with:
6262
name: SARIF file
6363
path: results.sarif
6464
retention-days: 5
6565

6666
- name: "Upload to code-scanning"
67-
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # 3.27.0
67+
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # 3.28.0
6868
with:
6969
sarif_file: results.sarif

pom.xml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
<dependency>
5151
<groupId>commons-io</groupId>
5252
<artifactId>commons-io</artifactId>
53-
<version>2.17.0</version>
53+
<version>${commons.io.version}</version>
5454
</dependency>
5555
<dependency>
5656
<groupId>commons-codec</groupId>
5757
<artifactId>commons-codec</artifactId>
58-
<version>1.17.1</version>
58+
<version>${commons.codec.version}</version>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.apache.commons</groupId>
@@ -177,14 +177,23 @@
177177
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
178178
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
179179
<commons.encoding>UTF-8</commons.encoding>
180-
181-
<checkstyle.header.file>${basedir}/src/conf/checkstyle/checkstyle-header.txt</checkstyle.header.file>
182-
<checkstyle.config.file>${basedir}/src/conf/checkstyle/checkstyle.xml</checkstyle.config.file>
183-
<checkstyle.suppress.file>${basedir}/src/conf/checkstyle/checkstyle-suppressions.xml</checkstyle.suppress.file>
184-
<checkstyle.resourceExcludes>LICENSE.txt, NOTICE.txt, **/maven-archiver/pom.properties</checkstyle.resourceExcludes>
185180
<japicmp.skip>false</japicmp.skip>
186181
<commons.release.isDistModule>true</commons.release.isDistModule>
187182
<project.build.outputTimestamp>2024-09-25T02:03:48Z</project.build.outputTimestamp>
183+
184+
<commons.codec.version>1.17.1</commons.codec.version>
185+
<commons.io.version>2.18.0</commons.io.version>
186+
187+
<!-- Apache Felix maven-bundle-plugin -->
188+
<commons.osgi.import>
189+
org.apache.commons.codec.binary;version="${commons.codec.version}",
190+
org.apache.commons.io;version="${commons.io.version}",
191+
org.apache.commons.io.build;version="${commons.io.version}",
192+
org.apache.commons.io.function;version="${commons.io.version}",
193+
org.apache.commons.io.input;version="${commons.io.version}",
194+
org.apache.commons.io.output;version="${commons.io.version}",
195+
*
196+
</commons.osgi.import>
188197
<!-- JaCoCo: Don't make code coverage worse than: -->
189198
<commons.jacoco.haltOnFailure>true</commons.jacoco.haltOnFailure>
190199
<commons.jacoco.classRatio>1.00</commons.jacoco.classRatio>
@@ -193,6 +202,11 @@
193202
<commons.jacoco.branchRatio>0.97</commons.jacoco.branchRatio>
194203
<commons.jacoco.lineRatio>0.99</commons.jacoco.lineRatio>
195204
<commons.jacoco.complexityRatio>0.96</commons.jacoco.complexityRatio>
205+
<!-- Checkstyle -->
206+
<checkstyle.header.file>${basedir}/src/conf/checkstyle/checkstyle-header.txt</checkstyle.header.file>
207+
<checkstyle.config.file>${basedir}/src/conf/checkstyle/checkstyle.xml</checkstyle.config.file>
208+
<checkstyle.suppress.file>${basedir}/src/conf/checkstyle/checkstyle-suppressions.xml</checkstyle.suppress.file>
209+
<checkstyle.resourceExcludes>LICENSE.txt, NOTICE.txt, **/maven-archiver/pom.properties</checkstyle.resourceExcludes>
196210
</properties>
197211
<build>
198212
<defaultGoal>clean verify apache-rat:check japicmp:cmp spotbugs:check pmd:check pmd:cpd-check javadoc:javadoc checkstyle:check</defaultGoal>
@@ -450,9 +464,8 @@
450464

451465
<!--
452466
Not in Maven Central, download manually from http://kasparov.skife.org/csv/csv-1.0.jar and install with:
453-
mkdir C:\Java\skife.org\
454-
curl https://repo.marketcetera.org/maven/org/skife/kasparov/csv/1.0/csv-1.0.jar -o C:\Java\skife.org\csv-1.0.jar
455-
mvn install:install-file -Dfile=C:/Java/skife.org/csv-1.0.jar -DgroupId=org.skife.kasparov -DartifactId=csv -Dversion=1.0 -Dpackaging=jar
467+
curl https://repo.marketcetera.org/maven/org/skife/kasparov/csv/1.0/csv-1.0.jar -o $TMPDIR/csv-1.0.jar
468+
mvn install:install-file -Dfile=$TMPDIR/csv-1.0.jar -DgroupId=org.skife.kasparov -DartifactId=csv -Dversion=1.0 -Dpackaging=jar
456469
-->
457470
<dependency>
458471
<groupId>org.skife.kasparov</groupId>

src/changes/changes.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@
4242
<body>
4343
<release version="1.13.0" date="YYYY-MM-DD" description="This is a feature and maintenance release. Java 8 or later is required.">
4444
<!-- FIX -->
45+
<action type="fix" issue="CSV-314" dev="ggregory" due-to="Gary Gregory">Required OSGi Import-Package version numbers in MANIFEST.MF #504.</action>
46+
<action type="fix" issue="CSV-314" dev="ggregory" due-to="Gary Gregory">CSVParser.nextRecord() should throw CSVException (an IOException subclass) instead of IOException and IllegalStateException, no method signature changes needed.</action>
4547
<!-- ADD -->
4648
<action type="add" issue="CSV-313" dev="ggregory" due-to="Gary Gregory">Add CSVPrinter.getRecordCount().</action>
4749
<action type="add" dev="ggregory" due-to="Gary Gregory">Add and use CSVParser.Builder and builder() and deprecate CSVParser constructors.</action>
4850
<action type="add" dev="ggregory" due-to="Gary Gregory">CSVFormat.Builder implements Supplier&lt;CSVFormat&gt;.</action>
4951
<action type="add" dev="ggregory" due-to="Gary Gregory">Deprecate CSVFormat.Builder.build() for get().</action>
5052
<!-- UPDATE -->
5153
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.apache.commons:commons-parent from 76 to 78 #486, #495.</action>
52-
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.codehaus.mojo:taglist-maven-plugin from 3.1.0 to 3.2.1 #493.</action>
54+
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.codehaus.mojo:taglist-maven-plugin from 3.1.0 to 3.2.1 #493.</action>
55+
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump commons-io:commons-io from 2.17.0 to 2.18.0 #505.</action>
5356
</release>
5457
<release version="1.12.0" date="2024-09-21" description="This is a feature and maintenance release. Java 8 or later is required.">
5558
<!-- ADD -->
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
/*
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
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
89
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* https://www.apache.org/licenses/LICENSE-2.0
1011
*
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.
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
1618
*/

src/conf/checkstyle/checkstyle.xml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,59 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
-->
18-
1918
<!DOCTYPE module PUBLIC
2019
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
2120
"https://checkstyle.org/dtds/configuration_1_3.dtd">
22-
23-
<!-- commons codec customization of default Checkstyle behavior -->
2421
<module name="Checker">
25-
<property name="localeLanguage" value="en" />
26-
<!-- Checks whether files end with a new line. -->
27-
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
28-
<module name="NewlineAtEndOfFile" />
29-
<!-- Verify that EVERY source file has the appropriate license -->
30-
<module name="Header">
31-
<property name="headerFile" value="${checkstyle.header.file}" />
32-
</module>
33-
<!-- Checks for Tab characters -->
34-
<!-- See http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter -->
3522
<module name="FileTabCharacter">
3623
<property name="fileExtensions" value="java,xml" />
3724
</module>
38-
<!-- Checks for white space at the end of the line -->
39-
<!-- See http://checkstyle.sourceforge.net/config_regexp.html -->
40-
<module name="RegexpSingleline">
41-
<property name="format" value="\s+$" />
42-
<property name="message" value="Line has trailing spaces." />
43-
<property name="fileExtensions" value="java" />
25+
<module name="Header">
26+
<property name="headerFile" value="${checkstyle.header.file}" />
4427
</module>
45-
<!-- @author tags are deprecated -->
28+
<module name="LineLength">
29+
<property name="max" value="160"/>
30+
</module>
31+
<module name="NewlineAtEndOfFile" />
4632
<module name="RegexpSingleline">
4733
<property name="format" value="^\s+\*\s+@author\s" />
4834
<property name="message" value="Deprecated @author tag" />
4935
<property name="fileExtensions" value="java" />
5036
<property name="severity" value="warning" />
5137
</module>
52-
<module name="LineLength">
53-
<property name="max" value="160"/>
38+
<module name="RegexpSingleline">
39+
<property name="format" value="\s+$" />
40+
<property name="message" value="Line has trailing spaces." />
41+
<property name="fileExtensions" value="java" />
5442
</module>
5543
<module name="TreeWalker">
44+
<module name="AvoidStarImport" />
45+
<module name="FinalLocalVariable" />
46+
<module name="IllegalImport" />
47+
<module name="ImportOrder">
48+
<property name="option" value="top" />
49+
<property name="groups" value="java,javax,org" />
50+
<property name="ordered" value="true" />
51+
<property name="separated" value="true" />
52+
</module>
53+
<module name="LeftCurly" />
54+
<module name="LocalFinalVariableName" />
55+
<module name="MissingOverride" />
56+
<module name="ModifierOrder" />
57+
<module name="NeedBraces" />
58+
<module name="NeedBraces" />
5659
<module name="OperatorWrap">
5760
<property name="option" value="eol" />
5861
</module>
59-
<module name="ImportOrder">
60-
<property name="option" value="top"/>
61-
<property name="groups" value="java,javax,org"/>
62-
<property name="ordered" value="true"/>
63-
<property name="separated" value="true"/>
64-
</module>
62+
<module name="RedundantImport" />
63+
<module name="RedundantModifier" />
64+
<module name="RightCurly" />
65+
<module name="UnusedImports" />
66+
<module name="UpperEll" />
6567
<module name="WhitespaceAfter" />
6668
<module name="WhitespaceAround" />
67-
<module name="WhitespaceAroundCheck" />
69+
<module name="WhitespaceAroundCheck" />
6870
</module>
69-
71+
<property name="localeLanguage" value="en" />
7072
</module>
7173

src/main/java/org/apache/commons/csv/CSVException.java

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

1820
package org.apache.commons.csv;

0 commit comments

Comments
 (0)