private int checkHeaderComment()

in src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java [418:435]


    private int checkHeaderComment(final List<String> commentLines) {
        if (loadCounter.get() == 1 && layoutData.isEmpty()) {
            int index = commentLines.size() - 1;
            // strip comments that belong to first key
            while (index >= 0 && StringUtils.isNotEmpty(commentLines.get(index))) {
                index--;
            }
            // strip blank lines
            while (index >= 0 && StringUtils.isEmpty(commentLines.get(index))) {
                index--;
            }
            if (getHeaderComment() == null) {
                setHeaderComment(extractComment(commentLines, 0, index));
            }
            return index + 1;
        }
        return 0;
    }