PreviousNextTracker indexSee it online !

(93/231) 2958459 - Unclosable buffer

I got again an unclosable buffer with 4.3.1.
I'm not sure what cause it, but the effect was that the buffer didn't have a mode set and this caused jEdit:1900 to throw a NPE. If it is appropriate for a buffer not to have a mode set, then there should be a null check, but I guess the problem is not the missing check but the missing mode. It could be that there was an IO Error when opening the file, I'm not sure about that.

Submitted vampire0 - 2010-02-25 - 01:44:52z Assigned kpouer
Priority 5 Category editor core
Status Open Group None
Resolution None Visibility No


2010-02-26 - 10:04:32z
When it happens, could you try to evaluate this beanshell snippet ?
It may be possible that the buffer was closed but not removed to the buffer list
2010-02-26 - 23:23:36z
As I'm not able to reproduce it and already closed that file I cannot test your BS snippet currently. But I think I didn't even had it open completely. As I said I think there was an IO error on opening it. As the mode was null this would also fit, wouldn't it? The mode ist not set to null when closing the buffer, is it?
2010-03-16 - 23:14:06z
No the mode is not set to null if you close the buffer, what was the exception ?
2010-03-16 - 23:33:17z
NPE = NullPointerException if that is your question
2011-12-07 - 21:05:27z
I think this is too old to find that bug if it sill exists
2011-12-07 - 22:48:32z
It should be possible to find out where the mode gets set to null and in which cases, don't you think so?
2011-12-07 - 22:55:33z
The only place where the mode field is modified is setMode() method and there is a if(mode == null)
throw new NullPointerException("Mode must be non-null");

So if the problem occurs you should have this exception and we should be able to see where it happens. But I don't think that any place in jedit would set that mode to null unless jEdit.getMode("text") returns null on your jEdit, and in that case your installation is completely broken
2011-12-07 - 23:09:18z
If this would have triggered, the mode would not have bee set to null, as the exception would have been thrown.
Maybe the mode was never set initially?