Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0, 2.1, 2.1.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8.0, 2.9.0, 2.10.0
-
None
-
None
Description
In the attached reproducer, I attempt to add a Path object to a configuration programmatically. This results in a StackOverflowError.
To reproduce, run with:
mvn test
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):
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)
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.