Skip to content

GUI Editor: ArrayIndexOutOfBoundsException #2570

@ChristianGruen

Description

@ChristianGruen

Caused by the Ctrl-Shift-Delete shortcut in the first line, if a file contains a single 0x0A character:

java.lang.ArrayIndexOutOfBoundsException: arraycopy: length -1 is negative
	at java.base/java.lang.System.arraycopy(Native Method)
	at org.basex.util.Array.copy(Array.java:124)
	at org.basex.util.list.ByteList.add(ByteList.java:70)
	at org.basex.gui.text.TextEditor.del(TextEditor.java:957)
	at org.basex.gui.text.TextEditor.delete(TextEditor.java:949)
	at org.basex.gui.text.TextEditor.deleteNext(TextEditor.java:999)
	at org.basex.gui.text.TextPanel.keyPressed(TextPanel.java:618)
	at org.basex.gui.view.editor.EditorArea.keyPressed(EditorArea.java:119)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions