in src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java [436:470]
public void load(final PropertiesConfiguration config, final Reader reader) throws ConfigurationException {
loadCounter.incrementAndGet();
@SuppressWarnings("resource") // createPropertiesReader wraps the reader.
final PropertiesConfiguration.PropertiesReader pReader = config.getIOFactory().createPropertiesReader(reader);
try {
while (pReader.nextProperty()) {
if (config.propertyLoaded(pReader.getPropertyName(), pReader.getPropertyValue(), seenStack)) {
final boolean contained = layoutData.containsKey(pReader.getPropertyName());
int blankLines = 0;
int idx = checkHeaderComment(pReader.getCommentLines());
while (idx < pReader.getCommentLines().size() && StringUtils.isEmpty(pReader.getCommentLines().get(idx))) {
idx++;
blankLines++;
}
final String comment = extractComment(pReader.getCommentLines(), idx, pReader.getCommentLines().size() - 1);
final PropertyLayoutData data = fetchLayoutData(pReader.getPropertyName());
if (contained) {
data.addComment(comment);
data.setSingleLine(false);
} else {
data.setComment(comment);
data.setBlankLines(blankLines);
data.setSeparator(pReader.getPropertySeparator());
}
}
}
setFooterComment(extractComment(pReader.getCommentLines(), 0, pReader.getCommentLines().size() - 1));
} catch (final IOException ioex) {
throw new ConfigurationException(ioex);
} finally {
loadCounter.decrementAndGet();
}
}