You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "garydgregory (via GitHub)" <gi...@apache.org> on 2024/04/23 13:54:22 UTC
Re: [PR] CONFIGURATION-844: Add support for empty sections [commons-configuration]
garydgregory commented on code in PR #408:
URL: https://github.com/apache/commons-configuration/pull/408#discussion_r1576307509
##########
src/main/java/org/apache/commons/configuration2/INIConfiguration.java:
##########
@@ -480,7 +485,11 @@ private void createNodeBuilders(final BufferedReader in, final ImmutableNode.Bui
if (!isCommentLine(line)) {
if (isSectionLine(line)) {
final int length = sectionInLineCommentsAllowed ? line.indexOf("]") : line.length() - 1;
- final String section = line.substring(1, length);
+ String section = line.substring(1, length);
+ if (section.isEmpty()) {
+ // use space for sections with no key
+ section = " ";
Review Comment:
Hello @steinerthomas
Thank you for your PR.
Why a space? What about an empty string?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org