#9 Editior freezes in XML mode

Editor (71)

Version 0.15.3

Started a new xml file and typed

<!-- Backup

Received error message of the form "expecting --" and
the editior froze. Would not let me continue typing.
Attempted to close file and reopen. Editior refused to
reopen file.


  • Peter Graves

    Peter Graves - 2002-07-03
    • status: open --> closed-fixed
  • Peter Graves

    Peter Graves - 2002-07-03

    Logged In: YES

    Amazingly enough this bug has been around for a long time,
    going back to January at least.

    The text in the buffer gets long enough to be parsed, so
    Aelfred takes a crack at it, and reports an error:

    end of input while looking for delimiter (started on line 1)
    (expected "--")

    For some reason, Aelfred throws a SAXParseException, rather
    than a java.io.EOFException, which would make more sense;
    Aelfred does throw an EOFException if you type, say "<foo
    bar='baz'". J ignores EOFExceptions, because they normally
    occur when you're not done typing yet, but because it's a
    SAXParseException, j displays the aforementioned error
    message and tries to place the caret at the location of the

    Aelfred is notoriously inaccurate at pinpointing the exact
    location of anything, and in this case Aelfred reports an
    offset of 18, even though there are only 11 characters in
    the buffer. Unfortunately, j 0.15.3 doesn't check this, and
    so dot gets placed beyond the end of the line, where the
    next character you type triggers an assertion failure in

    This bug is fixed in tonight's development snapshot:

    http://armedbear.org/j.zip (source)
    http://armedbear.org/j-jar.zip (just j.jar)

    The new code does sanity checking on the location Aelfred
    reports and corrects it if it's too weird.

    In addition, insertChar() now simply adjusts dot if it
    happens to be in an impossible location and calls
    Debug.bug(), which logs the error and carries on, rather
    than Debug.assertTrue(false), which causes the editor to hang.


Log in to post a comment.