Skip to content

Fix CSVFileParserTest.java to allow for a null return value from record.getComment()#62

Merged
garydgregory merged 2 commits into
apache:masterfrom
dota17:FixCSV246
Mar 25, 2020
Merged

Fix CSVFileParserTest.java to allow for a null return value from record.getComment()#62
garydgregory merged 2 commits into
apache:masterfrom
dota17:FixCSV246

Conversation

@dota17

@dota17 dota17 commented Mar 18, 2020

Copy link
Copy Markdown
Contributor

The old test case record.getComment() will never be null and if record.getComment() be null the test code misplace the null test.
Add a new test file that record.getComment() will be null and test record.getComment() no null before using.

…d.getComment() be null the test code misplace the null test.

Add a new test file that record.getComment() will be null and test record.getComment() no null before using
@coveralls

coveralls commented Mar 18, 2020

Copy link
Copy Markdown

Coverage Status

Coverage increased (+1.09%) to 96.418% when pulling 6e00f20 on dota17:FixCSV246 into ea7ffd7 on apache:master.

@garydgregory garydgregory changed the title fix the old test case record.getComment() will never be null Fix the old test case record.getComment() will never be null Mar 23, 2020
String parsed = Arrays.toString(record.values());
if (checkComments) {
final String comment = record.getComment().replace("\n", "\\n");
if (comment != null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the caching of "record.getComment()"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for review , I have fix that

if (comment != null) {
parsed += "#" + comment;
}
if (checkComments && record.getComment() != null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@dota17 dota17 requested a review from garydgregory March 24, 2020 02:25
@garydgregory garydgregory changed the title Fix the old test case record.getComment() will never be null Fix CSVFileParserTest.java to allow for a null return value from record.getComment() Mar 25, 2020
@garydgregory garydgregory merged commit 5591444 into apache:master Mar 25, 2020
asfgit pushed a commit that referenced this pull request Mar 25, 2020
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