Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 183000 - [Manifest][Editors] Blocking dialogs and NPE when switching between manifest editor source pages
Summary: [Manifest][Editors] Blocking dialogs and NPE when switching between manifest ...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.5 M7   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-18 12:20 EDT by Markus Keller CLA
Modified: 2009-04-21 14:57 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch to let a user switch to other pages in the manifest editor. (1.58 KB, patch)
2009-04-21 01:23 EDT, Deepak Azad CLA
curtis.windatt.public: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-04-18 12:20:50 EDT
I20070417-0800, follow-up to bug 94341.

- new workspace
- create new Plug-in project using the "Hello, World" template
- go to plugin.xml page and insert a '=' character at the beginning
- save

- in the Package Explorer, doubleclick MANIFEST.MF
=> Dialog "The source page has errors. Other pages cannot be used until these errors are corrected.". This is unexpected, since I just wanted to edit another source page.

- click OK
=> Editor changes to Overview page and shows same error dialog again. Should bug me at most once and should not kid me by showing and hiding another page.

- click OK
=> Editor switches back to plugin.xml page

- doubleclick build.properties
=> Error dialog again, followed by NPE below.


java.lang.NullPointerException
at org.eclipse.ui.forms.editor.FormPage.setActive(FormPage.java:124)
at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:621)
at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:525)
at org.eclipse.pde.internal.ui.editor.PDEFormEditor.setActivePage(PDEFormEditor.java:758)
at org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor.showEditorInput(ManifestEditor.java:657)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2648)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2592)
at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:2584)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2569)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2564)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2548)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2539)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:644)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:603)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:285)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:138)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:194)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:175)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:268)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:318)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$5.open(PackageExplorerPart.java:588)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:850)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:45)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:187)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1178)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:359)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:475)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:415)
at org.eclipse.equinox.launcher.Main.run(Main.java:1140)
at org.eclipse.equinox.launcher.Main.main(Main.java:1115)
Comment 1 Deepak Azad CLA 2009-04-21 01:21:16 EDT
Dialog "The source page has errors. Other pages cannot be used until these
errors are corrected."  -> The error is only in plugin.xml which is clearly shown to the user in package explorer and the problems view, hence the user should be allowed to edit other source pages.

I propose  
- even in case of errors the user is allowed to switch to other pages in the manifest editor. 
- as 'Extensions' and 'Extension Points' pages depend on plugin.xml, an error message can also be included in these pages.

Also, this dialog comes up only on switching from plugin.xml page to some other page, but if the Manifest.mf page is opened directly there is no such error.
Steps
- create new Plug-in project using the "Hello, World" template
- go to plugin.xml page and insert a '=' character at the beginning
- save
- close the manifest editor
- in the Package Explorer, doubleclick MANIFEST.MF. This opens successfully
- open 'extensions' and 'extension points' pages. These also open successfully but without any correct data and without any error message.
As the error in plugin.xml does not cause any problems in other pages the other pages should not be blocked.

Bug 273012 has been filed with Platform UI for the null pointer exception.
Comment 2 Deepak Azad CLA 2009-04-21 01:23:54 EDT
Created attachment 132547 [details]
Proposed patch to let a user switch to other pages in the manifest editor.
Comment 3 Curtis Windatt CLA 2009-04-21 14:56:56 EDT
Committed the patch.  This might not be the ultimate solution (no errors on the other pages, no direction for the user to tell them how to fix it), but it is a whole lot better than an unhelpful dialog and a system beep...