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