eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
81 stars 189 forks source link

IDEWorkbenchPreferencePage breaks ExtenstionFactory #2537

Open kerjes opened 2 days ago

kerjes commented 2 days ago

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 https://github.com/eclipse-platform/eclipse.platform.ui/blob/7aaa014a1d1053e012f2bc0b50eddff30cb2b50c/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java#L447 is initiated by https://github.com/eclipse-platform/eclipse.platform.ui/blob/7aaa014a1d1053e012f2bc0b50eddff30cb2b50c/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java#L219 and only called from https://github.com/eclipse-platform/eclipse.platform.ui/blob/7aaa014a1d1053e012f2bc0b50eddff30cb2b50c/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/IDEWorkbenchPreferencePage.java#L45 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 commented 1 day ago

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.