Open Death111 opened 11 months ago
Most likely this cannot happen with a valid database state. If I have e.g. 13 projects, the highest sort index should be 12. So when the logic "size - removedIndex" is executed (13-12) will instantiate a list with initial capacity 1. (It did occure in an invalid state with some REST API experiments which created "invalid" projects)
Following exception happened when deleting an project:
https://github.com/doubleSlashde/KeepTime/blob/019bffd40628a53886a4ea2195f1ca71af7b9e52/src/main/java/de/doubleslash/keeptime/controller/Controller.java#L303
Logic seems wrong: List is initialized with a capacity based on the sorting Index - which does not make sense?