Skip to content

NPE in Eclipse TextMate Grammar preference page #912

Closed

Description

@bvo42

Describe the bug

Spring Boot Language Server Feature breaks Eclipse preferences page Windows > Preferences > TextMate > Grammar.

When selecting an arbitrary grammar in the Create, edit or remove TextMate grammars the NPE below is thrown. With the NPW the whole preference page is no longer functional.

java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Button.setEnabled(boolean)" because the return value of "org.eclipse.tm4e.ui.internal.widgets.ThemeAssociationsWidget.getNewButton()" is null
	at org.eclipse.tm4e.ui.internal.preferences.GrammarPreferencePage$1.selectionChanged(GrammarPreferencePage.java:244)
	at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148)
	at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2128)
	at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205)
	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:263)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:421)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5796)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1529)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5025)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4477)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5796)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1529)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5025)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4477)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	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:643)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	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:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1440)

To Reproduce

  1. Download an unzip eclipse-java-2022-09-R-linux-gtk-x86_64.tar.gz
  2. Add STS update site https://download.springsource.com/release/TOOLS/sts4/update/e4.25/
  3. Install Spring Boot Language Server Feature
  4. Restart Eclipse
  5. Go to Windows > Preferences > TextMate > Grammar and select arbitrary grammar in table Create, edit or remove TextMate grammars

Activity

  1. added this to the 4.17.0.RELEASE milestone on Dec 1, 2022
  2. martinlippert commented on Dec 2, 2022

    @martinlippert
    Member

    Thanks @bvo42 for reporting this.

    • I can reproduce this with the STS 4.16.1.RELEASE build using a fresh install.
    • I cannot reproduce this anymore with the latest 4.17.0 CI builds, so looks like this doesn't happen anymore with the next upcoming release.

    Nevertheless, need to investigate why this happens on 4.16.1

  3. martinlippert commented on Dec 2, 2022

    @martinlippert
    Member

    You can fix this by installing the latest TM4E version from here:
    https://download.eclipse.org/tm4e/releases/0.6.2/

    Go to Install New Software, paste in the mentioned URL, and install the feature called TextMate Core. After that upgrade, the preference page works again.

    This new version of TM4E will be included by default in the upcoming 4.17.0.RELEASE.

  4. bvo42 commented on Dec 5, 2022

    @bvo42
    Author

    Upgrading TextMate Core from 0.5.1 to 0.5.2 helped. Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsetype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions