Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NETBEANS-54] Module Review db.sql.editor #23

Merged
merged 1 commit into from
Sep 30, 2017

Conversation

matthiasblaesing
Copy link
Contributor

  • no external library

  • checked Rat report; unrecognized license headers manually changed,
    missing headers added, ignored *.form (see central problems) and
    SQLExample. The latter file is used in the GUI as a sample and
    in addition does not reach a level of creativity.

  • skimmed through the module, did not notice additional problems

  • Modified tests to allow comments in *.test and *.pass files

boolean separatorRead = false;
for (String line; (line = reader.readLine()) != null;) {
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't the previous for line better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I consider the previous one less readable. The previous version mixed initialization, loop advance and checking and these parts are now separated into their corresponding sections.

Copy link
Member

Choose a reason for hiding this comment

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

I believe the canonical trick is to have

String line;
while((line = reader.readLine()) != null) {
  ...
}

And the original for just mixed those to limit the scope of the line variable to the for block... which is nice.

Your for repeats the reader.readLine() call which seems confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll revert my change to this loop and then push to master.

copyStream(input, pass);
} finally {
input.close();
try (InputStream input = SelectCompletionQueryTest.class.getResource(getName() + ".pass").openStream()) {
Copy link
Member

Choose a reason for hiding this comment

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

Changing this was not necessary. But if we do it, why not getResourceAsStream?

@matthiasblaesing
Copy link
Contributor Author

Thanks for looking into this. I let the changed for loop in place and updated the usage of getResource().openStream() to getResourceAsStream.

- no external library

- checked Rat report; unrecognized license headers manually changed, 
  missing headers added, ignored *.form (see central problems) and 
  SQLExample. The latter file is used in the GUI as a sample and
  in addition does not reach a level of creativity.

- skimmed through the module, did not notice additional problems

- Modified tests to allow comments in *.test and *.pass files
@asfgit asfgit merged commit ac84c02 into apache:master Sep 30, 2017
@matthiasblaesing matthiasblaesing deleted the db.sql.editor-review branch September 30, 2017 11:40
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