Skip to content

Fix Javadoc for CSVPrinter.getRecordCount(): the header record written by the constructor is counted - #633

Merged
garydgregory merged 1 commit into
apache:masterfrom
lenamonj:csv-printer-record-count-javadoc
Sep 7, 2026
Merged

Fix Javadoc for CSVPrinter.getRecordCount(): the header record written by the constructor is counted#633
garydgregory merged 1 commit into
apache:masterfrom
lenamonj:csv-printer-record-count-javadoc

Conversation

@lenamonj

@lenamonj lenamonj commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

CSVPrinter.getRecordCount() says "this does not include comments or headers", but the header record the constructor writes is counted: the test added with the method in CSV-313 asserts a count of 1 right after the header ("The header is the first record"). A caller reading the Javadoc gets one fewer than the printer reports whenever the format carries a header.

Javadoc only. It now says the constructor's header record is counted and that comments and printHeaders(ResultSet) are not.

Verified with the default mvn goal (checkstyle, PMD, SpotBugs, japicmp, RAT).

Found by an automated review loop I run; the change was reviewed and verified by me.

@uros-b

uros-b commented Sep 6, 2026

Copy link
Copy Markdown
Member

Nice javadoc update @lenamonj!

@garydgregory
garydgregory merged commit 66c88c7 into apache:master Sep 7, 2026
16 checks passed
@garydgregory

Copy link
Copy Markdown
Member

@lenamonj Thank you for the PR, merged 🚀

@garydgregory garydgregory changed the title Fix CSVPrinter.getRecordCount() Javadoc: the header record written by the constructor is counted Fix Javadoc for CSVPrinter.getRecordCount(): the header record written by the constructor is counted Sep 7, 2026
garydgregory added a commit that referenced this pull request Sep 7, 2026
@lenamonj
lenamonj deleted the csv-printer-record-count-javadoc branch September 7, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants