[BLUEJ-509] Runtime Exception after redo couple of times
I had noticed before that sometimes when "redo" for couple of times, the editor stop responding and I can't close it as well (have to restart Bluej).
I was running Bluej from the repository, the same thing happened and next Runtime Exception being fired:
{noformat} Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: javax.swing.text.BadLocationException: Length must be positive at bluej.editor.moe.MoeHighlighter$MoeHighlight.repaintHighlight(MoeHighlighter.java:106) at bluej.editor.moe.MoeHighlighter.addHighlight(MoeHighlighter.java:205) at bluej.editor.moe.MoeCaret.paintMatchingBracket(MoeCaret.java:156) at bluej.editor.moe.MoeEditor.doBracketMatch(MoeEditor.java:2874) at bluej.editor.moe.MoeEditor.caretMoved(MoeEditor.java:2836) at bluej.editor.moe.MoeCaret.fireStateChanged(MoeCaret.java:124) at javax.swing.text.DefaultCaret.changeCaretPosition(DefaultCaret.java:1255) at javax.swing.text.DefaultCaret.handleSetDot(DefaultCaret.java:1151) ....... Caused by: javax.swing.text.BadLocationException: Length must be positive at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:795) at bluej.editor.moe.MoePlainView.modelToView(MoePlainView.java:129) at javax.swing.text.View.modelToView(View.java:598) at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(BasicTextUI.java:1524) at bluej.editor.moe.MoeHighlighter$MoeHighlight.repaintHighlight(MoeHighlighter.java:101) ... 66 more {noformat}
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 3.1.4