@@ -206,8 +206,6 @@ public static Builder create(final CSVFormat csvFormat) {
206206 return new Builder (csvFormat );
207207 }
208208
209- private boolean allowEofWithoutClosingQuote ;
210-
211209 private boolean allowMissingColumnNames ;
212210
213211 private boolean allowTrailingText ;
@@ -269,7 +267,6 @@ private Builder(final CSVFormat csvFormat) {
269267 this .quotedNullString = csvFormat .quotedNullString ;
270268 this .duplicateHeaderMode = csvFormat .duplicateHeaderMode ;
271269 this .allowTrailingText = csvFormat .allowTrailingText ;
272- this .allowEofWithoutClosingQuote = csvFormat .allowEofWithoutClosingQuote ;
273270 }
274271
275272 /**
@@ -294,19 +291,6 @@ public Builder setAllowDuplicateHeaderNames(final boolean allowDuplicateHeaderNa
294291 return this ;
295292 }
296293
297- /**
298- * Sets whether the last field on the last line, if quoted, can have no closing quote when the file ends, {@code true} if this is ok,
299- * {@code false} if {@link IOException} should be thrown.
300- *
301- * @param allowEofWithoutClosingQuote whether to allow the last field on the last line to have a missing closing quote when the file ends,
302- * {@code true} if so, or {@code false} to cause an {@link IOException} to be thrown.
303- * @since 1.10.0
304- */
305- public Builder setAllowEofWithoutClosingQuote (final boolean allowEofWithoutClosingQuote ) {
306- this .allowEofWithoutClosingQuote = allowEofWithoutClosingQuote ;
307- return this ;
308- }
309-
310294 /**
311295 * Sets the parser missing column names behavior, {@code true} to allow missing column names in the header line, {@code false} to cause an
312296 * {@link IllegalArgumentException} to be thrown.
@@ -843,7 +827,7 @@ public CSVFormat getFormat() {
843827 * @see Predefined#Default
844828 */
845829 public static final CSVFormat DEFAULT = new CSVFormat (COMMA , DOUBLE_QUOTE_CHAR , null , null , null , false , true , CRLF , null , null , null , false , false , false ,
846- false , false , false , DuplicateHeaderMode .ALLOW_ALL , false , false );
830+ false , false , false , DuplicateHeaderMode .ALLOW_ALL , false );
847831
848832 /**
849833 * Excel file format (using a comma as the value delimiter). Note that the actual value delimiter used by Excel is locale dependent, it might be necessary
@@ -868,7 +852,6 @@ public CSVFormat getFormat() {
868852 * <li>{@code setAllowMissingColumnNames(true)}</li>
869853 * <li>{@code setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_ALL)}</li>
870854 * <li>{@code setAllowTrailingText(true)}</li>
871- * <li>{@code setAllowEofWithoutClosingQuote(true)}</li>
872855 * </ul>
873856 * <p>
874857 * Note: This is currently like {@link #RFC4180} plus {@link Builder#setAllowMissingColumnNames(boolean) Builder#setAllowMissingColumnNames(true)} and
@@ -882,7 +865,6 @@ public CSVFormat getFormat() {
882865 .setIgnoreEmptyLines (false )
883866 .setAllowMissingColumnNames (true )
884867 .setAllowTrailingText (true )
885- .setAllowEofWithoutClosingQuote (true )
886868 .build ();
887869 // @formatter:on
888870
@@ -1305,7 +1287,7 @@ private static boolean isTrimChar(final CharSequence charSequence, final int pos
13051287 */
13061288 public static CSVFormat newFormat (final char delimiter ) {
13071289 return new CSVFormat (String .valueOf (delimiter ), null , null , null , null , false , false , null , null , null , null , false , false , false , false , false , false ,
1308- DuplicateHeaderMode .ALLOW_ALL , false , false );
1290+ DuplicateHeaderMode .ALLOW_ALL , false );
13091291 }
13101292
13111293 static String [] toStringArray (final Object [] values ) {
@@ -1347,8 +1329,6 @@ public static CSVFormat valueOf(final String format) {
13471329
13481330 private final DuplicateHeaderMode duplicateHeaderMode ;
13491331
1350- private final boolean allowEofWithoutClosingQuote ;
1351-
13521332 private final boolean allowMissingColumnNames ;
13531333
13541334 private final boolean allowTrailingText ;
@@ -1408,7 +1388,6 @@ private CSVFormat(final Builder builder) {
14081388 this .quotedNullString = builder .quotedNullString ;
14091389 this .duplicateHeaderMode = builder .duplicateHeaderMode ;
14101390 this .allowTrailingText = builder .allowTrailingText ;
1411- this .allowEofWithoutClosingQuote = builder .allowEofWithoutClosingQuote ;
14121391 validate ();
14131392 }
14141393
@@ -1439,7 +1418,7 @@ private CSVFormat(final String delimiter, final Character quoteChar, final Quote
14391418 final boolean ignoreSurroundingSpaces , final boolean ignoreEmptyLines , final String recordSeparator , final String nullString ,
14401419 final Object [] headerComments , final String [] header , final boolean skipHeaderRecord , final boolean allowMissingColumnNames ,
14411420 final boolean ignoreHeaderCase , final boolean trim , final boolean trailingDelimiter , final boolean autoFlush ,
1442- final DuplicateHeaderMode duplicateHeaderMode , final boolean allowTrailingText , final boolean allowEofWithoutClosingQuote ) {
1421+ final DuplicateHeaderMode duplicateHeaderMode , final boolean allowTrailingText ) {
14431422 this .delimiter = delimiter ;
14441423 this .quoteCharacter = quoteChar ;
14451424 this .quoteMode = quoteMode ;
@@ -1460,7 +1439,6 @@ private CSVFormat(final String delimiter, final Character quoteChar, final Quote
14601439 this .quotedNullString = quoteCharacter + nullString + quoteCharacter ;
14611440 this .duplicateHeaderMode = duplicateHeaderMode ;
14621441 this .allowTrailingText = allowTrailingText ;
1463- this .allowEofWithoutClosingQuote = allowEofWithoutClosingQuote ;
14641442 validate ();
14651443 }
14661444
@@ -1515,7 +1493,7 @@ public boolean equals(final Object obj) {
15151493 Objects .equals (nullString , other .nullString ) && Objects .equals (quoteCharacter , other .quoteCharacter ) && quoteMode == other .quoteMode &&
15161494 Objects .equals (quotedNullString , other .quotedNullString ) && Objects .equals (recordSeparator , other .recordSeparator ) &&
15171495 skipHeaderRecord == other .skipHeaderRecord && trailingDelimiter == other .trailingDelimiter && trim == other .trim &&
1518- allowTrailingText == other .allowTrailingText && allowEofWithoutClosingQuote == other . allowEofWithoutClosingQuote ;
1496+ allowTrailingText == other .allowTrailingText ;
15191497 }
15201498
15211499 /**
@@ -1549,16 +1527,6 @@ public boolean getAllowDuplicateHeaderNames() {
15491527 return duplicateHeaderMode == DuplicateHeaderMode .ALLOW_ALL ;
15501528 }
15511529
1552- /**
1553- * Gets whether the file can end before the last field on the last line, if quoted, has a closing quote.
1554- *
1555- * @return {@code true} if so, {@code false} to throw an {@link IOException}.
1556- * @since 1.10.0
1557- */
1558- public boolean getAllowEofWithoutClosingQuote () {
1559- return allowEofWithoutClosingQuote ;
1560- }
1561-
15621530 /**
15631531 * Gets whether missing column names are allowed when parsing the header line.
15641532 *
@@ -1758,9 +1726,9 @@ public int hashCode() {
17581726 int result = 1 ;
17591727 result = prime * result + Arrays .hashCode (headers );
17601728 result = prime * result + Arrays .hashCode (headerComments );
1761- return prime * result + Objects .hash (duplicateHeaderMode , allowEofWithoutClosingQuote , allowMissingColumnNames , allowTrailingText ,
1762- autoFlush , commentMarker , delimiter , escapeCharacter , ignoreEmptyLines , ignoreHeaderCase , ignoreSurroundingSpaces ,
1763- nullString , quoteCharacter , quoteMode , quotedNullString , recordSeparator , skipHeaderRecord , trailingDelimiter , trim );
1729+ return prime * result + Objects .hash (duplicateHeaderMode , allowMissingColumnNames , allowTrailingText , autoFlush , commentMarker , delimiter ,
1730+ escapeCharacter , ignoreEmptyLines , ignoreHeaderCase , ignoreSurroundingSpaces , nullString , quoteCharacter , quoteMode , quotedNullString ,
1731+ recordSeparator , skipHeaderRecord , trailingDelimiter , trim );
17641732 }
17651733
17661734 /**
0 commit comments