MalformedURLException on 'Open description' link

Please provide

  • Operating system:
    Windows 11
  • SonarLint plugin version:
    9.2.0.81471
  • Programming language you’re coding in:
    Java
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version):
      SonarQube

And a thorough description of the problem / question:
Eclipse set to use internal browser
Eclipse told to use ‘Edge’ using ‘-Dorg.eclipse.swt.browser.DefaultType=edge’
Hover over a SonarLint tagged item and click on the ‘Open description’ link.
image

The ‘SonarLint Rule’ view opens up and a stacktrace appears in the ‘SonarLint Console’:

Starting SonarLint for Eclipse 9.2.0.81471
Starting SonarLint engine for connection 'sonar.as.it.ubc.ca'...
SonarLint analysis of project aap-to-sis-service (2 files processed)...
Starting standalone SonarLint engine 9.2.0.81471...
Started embedded server on port 64120
Found 29 issue(s)
The project 'aap-to-sis-service' is not bound either SonarQube or SonarCloud
Unable to open external browser
java.net.MalformedURLException: unknown protocol: data
	at java.base/java.net.URL.<init>(URL.java:681)
	at java.base/java.net.URL.<init>(URL.java:569)
	at java.base/java.net.URL.<init>(URL.java:516)
	at org.sonarlint.eclipse.ui.internal.util.BrowserUtils.lambda$0(BrowserUtils.java:45)
	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:4046)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3662)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:648)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
	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:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)

Hi @gnl42,

thanks for reaching out. The SonarLint Rule Description view internally uses a web browser (based on the Eclipse configuration, in your case MS Edge) to render the HTML rule.

It appears to me (as I cannot reproduce it, as I don’t have access to a Windows machine, and testing on macOS against Safari, Chrome, and Firefox did not show the issue) that MS Edge is the limitation.

What happens when you configure Eclipse to use another browser for the rendering? In the meantime, I try to get access to Windows to reproduce the issue (if possible and find the root cause).

What flavor and version of Eclipse are you using?

Best,
Tobias

Hi Tobias,

Changing the browser to an external one made no difference.

Its Eclipse for developers, 2023-12

Hi @gnl42,

thanks for the Info. As soon as possible I’ll try with a Windows machine.
In the meantime, I’ve played around with the SonarLint Rule Description view, if we can use another protocol other than the data protocol to communicate but with no success so far.

The rework of the SonarLint Rule Description view is on our agenda as a specific ticket HERE but it has not been prioritized yet. In the long run, we want to get rid of using browsers that are not only platform-specific but as you can see very faulty to rely on.

I’ll ping you on how we proceed once I spend some time with a Windows machine trying to recreate the issue.

Best,
Tobias