While saving a buffer, I got the following exception:
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 16431
at org.gjt.sp.jedit.buffer.JEditBuffer.getLineText(JEditBuffer.java:517)
at org.gjt.sp.jedit.buffer.JEditBuffer.getLineText(JEditBuffer.java:499)
at org.gjt.sp.jedit.bufferio.BufferIORequest.write(BufferIORequest.java:364)
at org.gjt.sp.jedit.bufferio.BufferAutosaveRequest.run(BufferAutosaveRequest.java:82)
at org.gjt.sp.util.WorkThread.doRequest(WorkThread.java:216)
at org.gjt.sp.util.WorkThread.doRequests(WorkThread.java:183)
at org.gjt.sp.util.WorkThread.run(WorkThread.java:157)
Additional information: This is a local text file with 16431 lines, which I've been
maintaining for several years now. I don't recall ever having exceptions while saving
it in the past. I frequently perform copy/paste/cut operations on the file, as well
as undo/redo, which might have caused the problem.
Submitted | shlomy - 2010-12-23 06:36:07 | Assigned | kpouer |
---|---|---|---|
Priority | 3 | Labels | editor core |
Status | open | Group | None |
Resolution | None |
2010-12-23 06:58:16 k_satoda |
This happens because BufferAutosaveRequest doesn't lock the buffer while
|
---|---|
2010-12-30 08:49:40 k_satoda |
> However, if BufferAutosaveRequest locks the buffer, any modification to
|
2010-12-30 09:08:05 shlomy |
I think it's better to do the locking. This change that you found was made more than
8 years ago. Since then, the performance must have changed greatly - both jEdit as
an application, the JRE and the storage.
|
2010-12-30 09:08:52 shlomy |
Another thing to note is that I received this shortly after saving a buffer. I find it strange the AutoSave saves the buffer shortly after I manually saved it, no? |
2011-01-08 10:25:52 kpouer |
I don't think we have a choice here, if we don't do the locking and some modifications
are done on the buffer during the saving operation we could have a saved file that
do not contains the real content of the buffer.
|
2011-01-08 17:20:23 k_satoda |
Sorry, I forgot to put the summary of discussion which I moved to
|