-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
for: backport-to-5.2.xIssues that will be back-ported to the 5.2.x lineIssues that will be back-ported to the 5.2.x linein: infrastructuretype: bug
Milestone
Description
Bug description
When calling RecursiveCollectionLineAggregator.aggregate() with an empty collection, the method throws a StringIndexOutOfBoundsException due to an unguarded StringBuilder.delete(...) call.
Expected behavior
It should return an empty string ("") without throwing an exception.
Minimal Complete Reproducible example
In RecursiveCollectionLineAggregatorTests.class:
@Test
void testSetDelegateAndPassEmptyCollection() {
RecursiveCollectionLineAggregator<String> aggregator = new RecursiveCollectionLineAggregator<>();
aggregator.setDelegate(item -> "bar");
assertEquals("", aggregator.aggregate(Collections.emptyList()));
}Result: java.lang.StringIndexOutOfBoundsException
fmbenhassine
Metadata
Metadata
Assignees
Labels
for: backport-to-5.2.xIssues that will be back-ported to the 5.2.x lineIssues that will be back-ported to the 5.2.x linein: infrastructuretype: bug