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

IDEWorkbenchPreferencePage breaks ExtenstionFactory #2537

Open
kerjes opened this issue Nov 25, 2024 · 1 comment
Open

IDEWorkbenchPreferencePage breaks ExtenstionFactory #2537

kerjes opened this issue Nov 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kerjes
Copy link

kerjes commented Nov 25, 2024

When extending in plugin.xml

   <extension
         point="org.eclipse.ui.preferencePages">
     <page
            category="mycategory"
            class="org.eclipse.ui.ExtensionFactory:workbenchPreferencePage"
            id="myid"
            name="MyName">
      </page>
    ...

one gets

java.lang.NullPointerException: Cannot invoke "org.eclipse.jface.preference.IntegerFieldEditor.getIntValue()" because "this.saveInterval" is null
  at org.eclipse.ui.internal.dialogs.WorkbenchPreferencePage.performOk(WorkbenchPreferencePage.java:447)
  at org.eclipse.jface.preference.PreferencePage.performApply(PreferencePage.java:457)
  at org.eclipse.jface.preference.PreferencePage.lambda$1(PreferencePage.java:289)

because

store.setValue(IPreferenceConstants.WORKBENCH_SAVE_INTERVAL, saveInterval.getIntValue());

is initiated by

and only called from

and ExtensionFactory does only initiate WorkbenchPreferencePage

https://github.com/eclipse-platform/eclipse.platform.ui/blob/7aaa014a1d1053e012f2bc0b50eddff30cb2b50c/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/ExtensionFactory.java#L182C1-L184C4

@jukzi jukzi added the bug Something isn't working label Nov 26, 2024
@jukzi
Copy link
Contributor

jukzi commented Nov 26, 2024

please propose a solution where either a) "saveInterval" is tagged mandatory and if missing an appropriate error message appears or b) define appropriate default value that is used and document it.

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

2 participants