Skip to content

Commit 2c7114f

Browse files
committed
Polish 'Use exclamation character for the document separator prefix'
See gh-32521
1 parent 33e379c commit 2c7114f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedPropertiesLoader.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* @author Madhura Bhave
4343
* @author Phillip Webb
4444
* @author Thiago Hirata
45+
* @author Guirong Hu
4546
*/
4647
class OriginTrackedPropertiesLoader {
4748

@@ -90,12 +91,12 @@ List<Document> load(boolean expandLists) throws IOException {
9091
if (document.isEmpty() && !documents.isEmpty()) {
9192
document = documents.remove(documents.size() - 1);
9293
}
93-
reader.setLastLineCommentPrefix(commentPrefixCharacter);
94+
reader.setLastLineCommentPrefixCharacter(commentPrefixCharacter);
9495
reader.skipComment();
9596
}
9697
}
9798
else {
98-
reader.setLastLineCommentPrefix(-1);
99+
reader.setLastLineCommentPrefixCharacter(-1);
99100
loadKeyAndValue(expandLists, document, reader, buffer);
100101
}
101102
}
@@ -197,7 +198,7 @@ private static class CharacterReader implements Closeable {
197198

198199
private int character;
199200

200-
private int lastLineCommentPrefix;
201+
private int lastLineCommentPrefixCharacter;
201202

202203
CharacterReader(Resource resource) throws IOException {
203204
this.reader = new LineNumberReader(
@@ -233,8 +234,8 @@ private void skipWhitespace() throws IOException {
233234
}
234235
}
235236

236-
private void setLastLineCommentPrefix(int lastLineCommentPrefix) {
237-
this.lastLineCommentPrefix = lastLineCommentPrefix;
237+
private void setLastLineCommentPrefixCharacter(int lastLineCommentPrefixCharacter) {
238+
this.lastLineCommentPrefixCharacter = lastLineCommentPrefixCharacter;
238239
}
239240

240241
private void skipComment() throws IOException {
@@ -307,7 +308,7 @@ Location getLocation() {
307308
}
308309

309310
boolean isSameLastLineCommentPrefix() {
310-
return this.lastLineCommentPrefix == this.character;
311+
return this.lastLineCommentPrefixCharacter == this.character;
311312
}
312313

313314
boolean isCommentPrefixCharacter() {

0 commit comments

Comments
 (0)