-
Notifications
You must be signed in to change notification settings - Fork 874
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
Conversation
boolean separatorRead = false; | ||
for (String line; (line = reader.readLine()) != null;) { | ||
for (String line = reader.readLine(); line != null; line = reader.readLine()) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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
?
ae8c59f
to
ef7b004
Compare
Thanks for looking into this. I let the changed for loop in place and updated the usage of |
- 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
ef7b004
to
ac84c02
Compare
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