You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FlatFileItemReaderBuilder.addComment() throws UnsupportedOperationException after comments(...) #5520
A subsequent addComment(String) calls List.add on that list and throws UnsupportedOperationException, although both methods are documented to compose ("Add a string to the list of Strings that indicate commented lines").
Environment
Spring Batch main at cb69762 (6.0.x), also present in 5.x. JDK 21.
Steps to reproduce
newFlatFileItemReaderBuilder<Foo>().name("fooReader")
.resource(resource)
.comments("@")
.addComment("+") // UnsupportedOperationException at AbstractList.add
...
Expected behavior comments(...) stores a mutable list (matching how the field default is initialized), so addComment(...) can be used afterwards. I will submit a PR with a fix and a test.
Activity
Fix UnsupportedOperationException in FlatFileItemReaderBuilder.addCom…
Fix UnsupportedOperationException in FlatFileItemReaderBuilder.addCom…
Fix UnsupportedOperationException in FlatFileItemReaderBuilder.addCom…