Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot invoke "org.eclipse.swt.browser.Browser.setRedraw(boolean)" because "this.fBrowser" is null #2449

Open
laeubi opened this issue Oct 27, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@laeubi
Copy link
Contributor

laeubi commented Oct 27, 2024

!ENTRY org.eclipse.ui 4 0 2024-10-27 18:52:37.949
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.browser.Browser.setRedraw(boolean)" because "this.fBrowser" is null
	at org.eclipse.jface.internal.text.html.BrowserInformationControl.setSize(BrowserInformationControl.java:378)
	at org.eclipse.lsp4e.operations.hover.FocusableBrowserInformationControl.lambda$0(FocusableBrowserInformationControl.java:121)
	at org.eclipse.swt.browser.ProgressListener$2.completed(ProgressListener.java:98)
	at org.eclipse.swt.browser.WebKit.lambda$7(WebKit.java:1765)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5040)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4520)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)

Happens on

Version: 2024-12 M2 (4.34.0 M2)
Build id: 20241024-0621

@laeubi laeubi added the bug Something isn't working label Oct 27, 2024
@jukzi
Copy link
Contributor

jukzi commented Oct 28, 2024

The error seems to be in org.eclipse.lsp4e.operations.hover.FocusableBrowserInformationControl
Closing at not platform. Please report to https://github.com/eclipse/lsp4e, would also help if you add information how to reproduce and which OS.

@jukzi jukzi closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2024
@laeubi
Copy link
Contributor Author

laeubi commented Oct 28, 2024

The error seems to be in org.eclipse.lsp4e.operations.hover.FocusableBrowserInformationControl

Why does it seem to? The last stackframe is

org.eclipse.jface.internal.text.html.BrowserInformationControl.setSize(BrowserInformationControl.java:378)

what has nothing to do with lsp4e.

As I have never seen such error before updating Eclipse from M1 > M2 I highly doubt it has something to do with lsp4e.

@laeubi laeubi reopened this Oct 28, 2024
@Phillipus
Copy link
Contributor

Looking at FocusableBrowserInformationControl and BrowserInformationControl it seems that fBrowser will be null when BrowserInformationControl is disposed:

Perhaps it is being disposed of somewhere in the lsp4e code but their ProgressListener is still active. I would say that it would be more fruitful to investigate on lsp4e first rather than platform.

@laeubi
Copy link
Contributor Author

laeubi commented Oct 28, 2024

I would say that it would be more fruitful to investigate on lsp4e first rather than platform.

So you mean why fix it one better fix it on multiple places ;-)

In general I think it would be legal to throw an exception but

  1. the API does not claim to throw any (an especially not a NPE)
  2. looking at the code it looks like disposing might be time based in an async fashion so why not account for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants