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
Following exception happened when deleting an project:
java.lang.IllegalArgumentException: Illegal Capacity: -1
at java.base/java.util.ArrayList.<init>(ArrayList.java:158)
at de.doubleslash.keeptime.controller.Controller.adaptProjectIndexesAfterRemoving(Controller.java:304)
at de.doubleslash.keeptime.controller.Controller.deleteProject(Controller.java:194)
at de.doubleslash.keeptime.REST_API.controller.ProjectController.deleteProject(ProjectController.java:111)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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:
KeepTime/src/main/java/de/doubleslash/keeptime/controller/Controller.java
Line 303 in 019bffd
Logic seems wrong: List is initialized with a capacity based on the sorting Index - which does not make sense?
The text was updated successfully, but these errors were encountered: