Uploaded image for project: 'BlueJ'
  1. BlueJ
  2. BLUEJ-984

Pressing enter at end of file causes exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.1.0
    • Component/s: Java editor
    • Sprint:
      4.1.0

      Description

      There is a bug in the newline action which throws an exception if the caret is at the end of the file (end of last line) when you press enter:

      Exception in thread "JavaFX Application Thread" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(String.java:658)
      at bluej.editor.moe.MoeActions.doIndent(MoeActions.java:812)
      at bluej.editor.moe.MoeActions.lambda$newLineAction$30(MoeActions.java:1473)
      at bluej.editor.moe.MoeActions$1.actionPerformed(MoeActions.java:1148)
      at bluej.editor.moe.MoeActions.lambda$null$1(MoeActions.java:154)
      at org.fxmisc.wellbehaved.event.InputMap.lambda$consume$7(InputMap.java:93)

        Attachments

          Activity

            People

            • Assignee:
              nccb Neil Brown
              Reporter:
              nccb Neil Brown
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: