Skip to content

Commit

Permalink
CSV-196: Remove duplicated Charset (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenJAN authored Nov 19, 2024
1 parent 3599f5b commit 344f282
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/main/java/org/apache/commons/csv/CSVParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public static class Builder extends AbstractStreamBuilder<CSVParser, Builder> {
private CSVFormat format;
private long characterOffset;
private long recordNumber = 1;
private Charset charset;

/**
* Constructs a new instance.
Expand All @@ -165,7 +164,7 @@ protected Builder() {
@SuppressWarnings("resource")
@Override
public CSVParser get() throws IOException {
return new CSVParser(getReader(), format != null ? format : CSVFormat.DEFAULT, characterOffset, recordNumber, charset);
return new CSVParser(getReader(), format != null ? format : CSVFormat.DEFAULT, characterOffset, recordNumber, getCharset());
}

/**
Expand Down Expand Up @@ -201,16 +200,6 @@ public Builder setRecordNumber(final long recordNumber) {
return asThis();
}

/**
* Sets the character encoding to be used for the reader.
*
* @param charset the character encoding.
* @return this instance.
*/
public Builder setCharset(final Charset charset) {
this.charset = charset;
return asThis();
}
}

final class CSVRecordIterator implements Iterator<CSVRecord> {
Expand Down

0 comments on commit 344f282

Please sign in to comment.