Skip to content

Commit

Permalink
Polish 'Use exclamation character for the document separator prefix'
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Oct 19, 2022
1 parent 33e379c commit 2c7114f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
* @author Madhura Bhave
* @author Phillip Webb
* @author Thiago Hirata
* @author Guirong Hu
*/
class OriginTrackedPropertiesLoader {

Expand Down Expand Up @@ -90,12 +91,12 @@ List<Document> load(boolean expandLists) throws IOException {
if (document.isEmpty() && !documents.isEmpty()) {
document = documents.remove(documents.size() - 1);
}
reader.setLastLineCommentPrefix(commentPrefixCharacter);
reader.setLastLineCommentPrefixCharacter(commentPrefixCharacter);
reader.skipComment();
}
}
else {
reader.setLastLineCommentPrefix(-1);
reader.setLastLineCommentPrefixCharacter(-1);
loadKeyAndValue(expandLists, document, reader, buffer);
}
}
Expand Down Expand Up @@ -197,7 +198,7 @@ private static class CharacterReader implements Closeable {

private int character;

private int lastLineCommentPrefix;
private int lastLineCommentPrefixCharacter;

CharacterReader(Resource resource) throws IOException {
this.reader = new LineNumberReader(
Expand Down Expand Up @@ -233,8 +234,8 @@ private void skipWhitespace() throws IOException {
}
}

private void setLastLineCommentPrefix(int lastLineCommentPrefix) {
this.lastLineCommentPrefix = lastLineCommentPrefix;
private void setLastLineCommentPrefixCharacter(int lastLineCommentPrefixCharacter) {
this.lastLineCommentPrefixCharacter = lastLineCommentPrefixCharacter;
}

private void skipComment() throws IOException {
Expand Down Expand Up @@ -307,7 +308,7 @@ Location getLocation() {
}

boolean isSameLastLineCommentPrefix() {
return this.lastLineCommentPrefix == this.character;
return this.lastLineCommentPrefixCharacter == this.character;
}

boolean isCommentPrefixCharacter() {
Expand Down

0 comments on commit 2c7114f

Please sign in to comment.