[Crash] StrawUtils tries to sort immutable list causing crash
Linguardium opened this issue ยท 0 comments
toList does not guarantee on mutability. the List.sort mutates the list. Instead something like this should be used:
stream.collect(Collectors.toCollection(ArrayList::new))
or the stream should be sorted before collection to the potentially immutable list
stream.sorted(Comparator.comparingInt(StrawHandler::getPriority)).toList()