Skip to content

Commit 13d10d7

Browse files
authored
CSV-320: Remove Spotbugs Dependency and use exclude-filter instead (#564)
Removes the Spotbugs dependency that introduces a compile time dependency to CsvPrinter.
1 parent 60287ca commit 13d10d7

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@
6868
<version>${commons.jmh.version}</version>
6969
<scope>test</scope>
7070
</dependency>
71-
<dependency>
72-
<groupId>com.github.spotbugs</groupId>
73-
<artifactId>spotbugs-annotations</artifactId>
74-
<version>${commons.spotbugs.impl.version}</version>
75-
<optional>true</optional>
76-
</dependency>
7771
</dependencies>
7872
<scm>
7973
<connection>scm:git:https://gitbox.apache.org/repos/asf/commons-csv.git</connection>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040

4141
import org.apache.commons.io.function.IOStream;
4242

43-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
44-
4543
/**
4644
* Prints values in a {@link CSVFormat CSV format}.
4745
*
@@ -153,7 +151,6 @@ public void close(final boolean flush) throws IOException {
153151
* @throws IOException
154152
* If an I/O error occurs
155153
*/
156-
@SuppressFBWarnings(value = "AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE", justification = "https://github.com/spotbugs/spotbugs/issues/3428")
157154
private void endOfRecord() throws IOException {
158155
println();
159156
recordCount++;

src/site/resources/spotbugs/spotbugs-exclude-filter.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,12 @@
5454
<Method name="values" />
5555
<Bug pattern="EI_EXPOSE_REP"/>
5656
</Match>
57+
58+
<!-- https://github.com/spotbugs/spotbugs/issues/3428 -->
59+
<Match>
60+
<Class name="org.apache.commons.csv.CSVPrinter" />
61+
<Method name="endOfRecord" />
62+
<Bug pattern="AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE" />
63+
</Match>
5764

5865
</FindBugsFilter>

0 commit comments

Comments
 (0)