Bob Marinier created CONFIGURATION-840:
------------------------------------------

             Summary: StackOverflowError when adding property
                 Key: CONFIGURATION-840
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-840
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 2.10.0, 2.9.0, 2.8.0, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 
2.1.1, 2.1, 2.0
            Reporter: Bob Marinier
         Attachments: reproducer.zip

In the attached reproducer, I attempt to add a Path object to a configuration 
programmatically. This results in a StackOverflowError.

To reproduce, run with:
{code:java}
mvn test{code}
It may be that adding a Path object is not supported (indeed, when I did this I 
meant to add it as a String), but even so it should not result in a 
StackOverflowError.

The start of the stack is shown below (this just the last two lines just repeat 
until overflow):
{code:java}
java.lang.StackOverflowError
        at 
java.base/sun.nio.fs.WindowsPath.elementAsString(WindowsPath.java:681)
        at java.base/sun.nio.fs.WindowsPath.getName(WindowsPath.java:692)
        at java.base/sun.nio.fs.WindowsPath.getName(WindowsPath.java:42)
        at java.base/java.nio.file.Path$1.next(Path.java:931)
        at java.base/java.nio.file.Path$1.next(Path.java:920)
        at 
org.apache.commons.configuration2.convert.AbstractListDelimiterHandler.flattenIterator(AbstractListDelimiterHandler.java:198)
        at 
org.apache.commons.configuration2.convert.AbstractListDelimiterHandler.flatten(AbstractListDelimiterHandler.java:146)
        at 
org.apache.commons.configuration2.convert.AbstractListDelimiterHandler.flattenIterator(AbstractListDelimiterHandler.java:198)
        at 
org.apache.commons.configuration2.convert.AbstractListDelimiterHandler.flatten(AbstractListDelimiterHandler.java:146)
        at 
org.apache.commons.configuration2.convert.AbstractListDelimiterHandler.flattenIterator(AbstractListDelimiterHandler.java:198)
        at 
org.apache.commons.configuration2.convert.AbstractListDelimiterHandler.flatten(AbstractListDelimiterHandler.java:146){code}
As this appears to involve delimiter handling I even tried to configure it to 
use the DisabledListDelimiterHandler (not part of the reproducer), but this had 
no effect.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to