Skip to content

Minor Improvements#127

Merged
garydgregory merged 1 commit into
apache:masterfrom
arturobernalg:feature/minor_improvement
Dec 30, 2020
Merged

Minor Improvements#127
garydgregory merged 1 commit into
apache:masterfrom
arturobernalg:feature/minor_improvement

Conversation

@arturobernalg

Copy link
Copy Markdown
Member
  • Add final
  • Unnecessary semicolon ''
  • Use StandardCharsets
  • Fix javadoc

@coveralls

coveralls commented Dec 18, 2020

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.002%) to 98.454% when pulling 1682795 on arturobernalg:feature/minor_improvement into 8e953c0 on apache:master.

* Tests reusing a parser to process new string records one at a time as they are being discovered. See [CSV-110].
*
* @throws IOException
* @throws Exception Any exception can be thrown

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.

Does not match the code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

changed

* Verifies the consistency of the parameters and throws an IllegalArgumentException if necessary.
*
* @throws IllegalArgumentException
* thrown if the delimiter is a scape character

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.

"scape"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

changed. What do you thing?=

* Tests reusing a parser to process new string records one at a time as they are being discovered. See [CSV-110].
*
* @throws IOException
* @throws IOException If something goes wrong

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.

Might as well use the "standard" comment here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sorry Garry, but What is the standard comment?

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.

@arturobernalg
The JRE uses "if an I/O error occurs." but I prefer "Thrown when an I/O error occurs."

@arturobernalg arturobernalg Dec 29, 2020

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok, got it. changed


private static int num = 0; // number of elapsed times recorded
private static long[] elapsedTimes = new long[max];
private static final long[] elapsedTimes = new long[max];

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.

Constants are usually in uppercase.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

true. changed

// Now parse the file and compare against the expected results
final URL resource = ClassLoader.getSystemResource("org/apache/commons/csv/CSVFileParser/" + split[0]);
try (final CSVParser parser = CSVParser.parse(resource, Charset.forName("UTF-8"), format)) {
try (final CSVParser parser = CSVParser.parse(resource, StandardCharsets.UTF_8, format)) {

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.

Good one :-)

* Verifies the consistency of the parameters and throws an IllegalArgumentException if necessary.
*
* @throws IllegalArgumentException
* @throws IllegalArgumentException If something goes wrong

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.

Hi @arturobernalg
This change does not help anyone, and it's confusing when the line above tells you when the exception would be thrown. I've updated git master for this Javadoc. Please rebase on master. TY.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK. Got it. Changed

* Tests an exported Excel worksheet with a header row and rows that have more columns than the headers
*
* @throws Exception
* @throws Exception Any exception can be thrown

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.

Not helpful. Tests like this one can throw Exception as a convention instead of throwing a potentially long list of exceptions which are not useful and just clutter up the method signatures. So either we should not have a Javadoc tag or if we have one, it should carry proper and useful documentation. In this case, I think that there is nothing interesting to say.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK, got it. Reverted

* Add final
* Unnecessary semicolon ''
* Use StandardCharsets
* Fix javadoc
@garydgregory garydgregory changed the title Minor Improvement Minor Improvements Dec 30, 2020
@garydgregory garydgregory merged commit d580c90 into apache:master Dec 30, 2020
asfgit pushed a commit that referenced this pull request Dec 30, 2020
@arturobernalg arturobernalg deleted the feature/minor_improvement branch January 24, 2021 18:57
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