[MGNLUI-3892] Updating sortable node children may throw ArrayIndexOutOfBoundsException Created: 25/May/16  Updated: 30/May/16  Resolved: 27/May/16

Status: Closed
Project: Magnolia UI
Component/s: vaadin integration
Affects Version/s: None
Fix Version/s: 5.4.7

Type: Bug Priority: Neutral
Reporter: Federico Grilli Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2.5h
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLUI-3860 MultiValueChilNodeTransformer does no... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Sprint: Basel 46
Story Points: 1

 Description   

When updating children of a sortable node with AbstractJcrNodeAdapter.updateChildren() code might end up to check for an array element at position -1 which would throw

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:400)
at java.util.ArrayList.remove(ArrayList.java:477)
at info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter.sortChildren(AbstractJcrNodeAdapter.java:249)
at info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter.updateChildren(AbstractJcrNodeAdapter.java:215)
at info.magnolia.security.app.dialog.action.SaveUserDialogAction.createOrUpdateUser(SaveUserDialogAction.java:183)
at info.magnolia.security.app.dialog.action.SaveUserDialogAction.execute(SaveUserDialogAction.java:97)
at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62)
... 123 more

Generated at Mon Feb 12 09:11:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.