Community
Participate
Working Groups
Build Identifier: I20110310-1119 When opened with unknown editor input the target definition editor will fail to open and display a NPE. Currently IFileEditorInput and IURIEditorInput are supported. e.g. Team history views will use other editor inputs. Probably sub types of IStorageEditorInput. I'll attach two patch proposals. The first very simple one will just prevent the NPE and inform the user. The second patch proposal introduce support for any kind of IStorageEditorInput. (incl. save behavior as described in IStorageEditorInput documentation) Reproducible: Always Steps to Reproduce: 1. open a target file from EGit history view
Created attachment 194941 [details] Simple Patch
Created attachment 194942 [details] Support StorageEditorInput patch
Consider for RC1 (at least the simple patch).
I'm not confident enough with the storage editor input patch to put it in for RC1. Still looking at the simple patch for RC1 inclusion. We'll clone the bug for consideration in 3.8. Once you have used the save option (runs save as), I get the following NPE because the target doesn't have a proper backing handle. java.lang.NullPointerException at org.eclipse.pde.internal.core.target.TargetPlatformService.saveTargetDefinition(TargetPlatformService.java:244) at org.eclipse.pde.internal.ui.editor.targetdefinition.TargetEditor$InputHandler.saveTargetDefinition(TargetEditor.java:400) at org.eclipse.pde.internal.ui.editor.targetdefinition.TargetEditor.doSave(TargetEditor.java:94) at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:151) at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:277) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
The simple patch gets a +1 from me. Only change I would suggest is not having the \n in TargetEditor_6 string. Ankur, please review and commit for RC1. This bug was cloned as bug 345016 to consider expanding editor support in 3.8.
-1 for the patch for two reasons: - Opening an editor should never show a dialog. - The correct fix is to throw a PartInitException which will then result in an exception in the log but on the other hand it will show the file inside a text editor (this is the default fallback code in Platform Team).
Created attachment 195050 [details] Fail with PartInitException
Ankur, you can commit my patch if you're happy with it.
I didn't commit it because I want sure it shall get counted as contributed. Will commit after verifying.
I was referring to the 'simple patch'. Testing Dani's patch now and will commit it asap.
+1 Applied to HEAD
Verified in I20110514-0800