I have been a using jEdit for many years and I am very happy with this text editor. I particularly value its flexibility, powerful macro support, and portability between computers and operating systems.
I am not a programmer. ChatGPT assisted with the analysis of this bug detected in several separate occurrences, and suggested corrections from my activity.log observations and available jEdit source. I no longer have the relevant logs available. Please treat the proposed explanations and fixes as suggestions for maintainer verification.
jEdit 5.7.0 can throw an uncaught NullPointerException on the AWT Event Dispatch Thread when org.gjt.sp.jedit.gui.statusbar.HoverSetStatusMouseHandler.cleanupStatusBar() handles a mouse-release event after a global PropertiesChanged refresh has replaced the hovered menu or toolbar component.
The cleanup code calls GUIUtilities.getView((Component) evt.getSource()).getStatus() without checking whether getView() returns null, despite the API permitting a null result for detached components. This exact NPE was observed on 2026-09-15, 2026-09-16, and 2026-09-23.
jEdit: 5.7.0; reported build: 2025-08-08
Java runtime: 17.0.20.1
OS: Linux 6.8.0-138-generic, amd64
jEdit server (local session): Master (21.11.2026 4:25:40)
Active plugins (current snapshot, not necessarily historical incident versions):
ActionHooks 0.6; BufferTabs 1.2.5; CandyFolds 1.2.3; Character Map 1.3.3;
Common Controls 1.7.4; Console 5.1.4; Context Menu 0.4; DirtyGutter 0.3b;
Editor Scheme 1.8; ErrorList 2.4.0; FTP 1.4; Finish Him! 0.9;
FoldViewer 1.1; GnuRegexp 1.0.1; Image Viewer 1.4; Info Viewer 1.6.3;
JDiff Plugin 3.4.0; Jakarta Commons 0.9; Menu Editor 0.5; MetalColor 1.1.0;
Mouse Snap 0.1; OpenIt 1.6.0; Project Viewer 3.6; QuickNotepad 5.0;
RecentBufferSwitcher 0.2; Reopen 0.6; Scala Plugin 1.1.0; TaskList 2.7;
Templates 5.1.0; TextTools 1.16; Undo Repair 1.1.0; WhiteSpace 1.0.3;
XSearch 1.9.
Relevant active plugins: ActionHooks 0.6 and JDiff Plugin 3.4.0 were present in one local trigger scenario; neither is implicated as the failing implementation. The exception runs on AWT-EventQueue-0.
HoverSetStatusMouseHandler installed; its hover message is active (msgSet == true).jEdit.propertiesChanged() or equivalent refresh causes the View to replace its menu bar / reload toolbars.mouseReleased() (or potentially mouseExited()) reaches the original listener.cleanupStatusBar() looks up the parent View for the now-detached component; GUIUtilities.getView(...) returns null..getStatus() dereference throws on the EDT.PropertiesChanged handling was followed by the NPE. A failed request to change the Look-and-Feel to JTattoo Aero was also logged; its necessity for the failure is unproven.BufferUpdate.PROPERTIES_CHANGED messages and then a global PropertiesChanged preceded the same NPE. A custom ActionHooks macro had called jEdit.propertiesChanged() after changing only one buffer's wrap property.buffer.propertiesChanged(). The cause of this later global refresh was not captured by the available log excerpt.A mouse listener must tolerate a component becoming detached during a legitimate UI rebuild. It should clear its hover-message state safely without throwing, even if there is no longer a parent View.
java.lang.NullPointerException:
Cannot invoke "org.gjt.sp.jedit.View.getStatus()"
because the return value of
"org.gjt.sp.jedit.GUIUtilities.getView(java.awt.Component)" is null
at org.gjt.sp.jedit.gui.statusbar.HoverSetStatusMouseHandler.cleanupStatusBar(HoverSetStatusMouseHandler.java:76)
at org.gjt.sp.jedit.gui.statusbar.HoverSetStatusMouseHandler.mouseReleased(HoverSetStatusMouseHandler.java:50)
The affected cleanup path effectively does:
if (msgSet)
{
StatusBar statusBar =
GUIUtilities.getView((Component) evt.getSource()).getStatus();
if (msg == statusBar.getMessage())
statusBar.setMessage(null);
msgSet = false;
msg = null;
}
GUIUtilities.getView(Component) is documented as potentially returning null. View.propertiesChanged() can replace the menu bar with setJMenuBar(...) and reload toolbars. This explains how a component associated with a View during mouseEntered() may be detached before cleanup.
Resolve the View once and only access its status bar when it is non-null. Reset state regardless of whether a View remains attached. Apply the same defensive check in mouseEntered().
if (msgSet)
{
View owner = GUIUtilities.getView((Component) evt.getSource());
if (owner != null)
{
StatusBar statusBar = owner.getStatus();
if (msg == statusBar.getMessage())
statusBar.setMessage(null);
}
msgSet = false;
msg = null;
}
This is a suggested null guard; maintainers should also review any surrounding state-lifetime assumptions.
One contributing custom ActionHooks call was corrected from jEdit.propertiesChanged() to buffer.propertiesChanged() for a local wrap change. This reduced unnecessary View-wide UI replacement, but the failure recurred afterward, showing it was not a complete fix. JDiff's dockable was relevant only to that custom wrap-management path. No ActionHooks or JDiff class appears in the exception stack.
Core https://sourceforge.net/p/jedit/bugs/4153/ reports a different nullable-return failure in TextAreaMouseHandler.doSingleClick() (offsetToXY()), requiring a separate code correction. Similar null-dereference symptoms alone do not make these tickets duplicates.
No equivalent HoverSetStatusMouseHandler ticket was identified in accessible core/plugin tracker search results as of 2026-11-21.