| Summary: | WSDM Tooling: No proper validation done for MRT and DDE files when user defined capability/MRT is removed from MRT/DDE | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Balan Subramanian <bsubram> | ||||||||
| Component: | TPTP.monitoring | Assignee: | Andrew Eberbach <aeberbac> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | Bhanu Prathap V <bhanu.prathap> | ||||||||
| Severity: | major | ||||||||||
| Priority: | P1 | CC: | harihnar, jacalcat | ||||||||
| Version: | unspecified | Keywords: | plan | ||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | 169672 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
*** Bug 167376 has been marked as a duplicate of this bug. *** Created attachment 55650 [details]
167374 patch
After some discussion here's a suggestion. This bug should be left until later in the development cycle because the issue, while being important, is lower priority than other bugs. Also, I think that we need to handle invalid capabilities in a more robust way. The proposed approach is to maker the individual capabilities in the MRT view as invalid with an icon and also put the capabilites that are invalid in the problems view. Also, later when 167574 is fixed because it will introduce a listener/notifier scheme for listening to changes in the capabilities. Cannot be verified due to capablity editor blocking issue When opening MRT file No capabilities shows up in the Manageable End Point section, below is the error log org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Resource '/Test/new_file.mcap' does not exist. at org.eclipse.emf.ecore.resource.impl.URIConverterImpl$WorkbenchHelper.createPlatformResourceInputStream(URIConverterImpl.java:199) at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createPlatformResourceInputStream(URIConverterImpl.java:540) at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createInputStream(URIConverterImpl.java:449) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:897) at org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils.getWSDLDefinition(WsdlUtils.java:118) at org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils.getWSDLDefinition(WsdlUtils.java:93) at org.eclipse.tptp.wsdm.tooling.util.internal.MrtUtils.getDefinition(MrtUtils.java:136) at org.eclipse.tptp.wsdm.tooling.util.internal.MrtUtils.getCapabilities(MrtUtils.java:126) at org.eclipse.tptp.wsdm.tooling.editor.mrt.internal.NewMrtPageEditor.createPrototypePage(NewMrtPageEditor.java:176) at org.eclipse.tptp.wsdm.tooling.editor.mrt.internal.NewMrtPageEditor.createPages(NewMrtPageEditor.java:163) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:278) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:641) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:411) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:293) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140) at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268) at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:394) at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1156) at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1109) at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1335) at org.eclipse.ui.internal.PartStack.add(PartStack.java:458) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) at org.eclipse.ui.internal.PartStack.add(PartStack.java:444) at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112) at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:65) at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217) at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207) at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:855) at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:754) at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:715) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2586) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2516) at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2508) at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2493) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2488) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2472) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2463) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:638) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:597) 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:195) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:176) 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:584) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:819) 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:153) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:817) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1078) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1177) 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:927) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3465) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3079) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2083) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2047) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:449) 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:145) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:170) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:474) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:414) at org.eclipse.equinox.launcher.Main.run(Main.java:1122) Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/Test/new_file.mcap' does not exist. at java.lang.Throwable.<init>(Throwable.java:57) at java.lang.Throwable.<init>(Throwable.java:68) at org.eclipse.core.runtime.CoreException.<init>(CoreException.java:43) at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:35) at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:310) at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:193) at org.eclipse.core.internal.resources.File.getContents(File.java:285) at org.eclipse.core.internal.resources.File.getContents(File.java:276) at org.eclipse.emf.ecore.resource.impl.URIConverterImpl$WorkbenchHelper.createPlatformResourceInputStream(URIConverterImpl.java:195) ... 81 more Above mentioned Comments is based on the below build Build ID: TPTP-4.4.0-200701290100 Target to iteration 2 as per Balan's spreadsheet. Unable to create Custom Capability, so i cannot verify this defect Candidate Build: TPTP-4.4.0-200702050100 WTP : wtp-I-I200702011746-200702011746 Created attachment 58851 [details]
167374 patch and error during build problem fixed
Patched applied to tptp cvs 1. i created mrt file with one custom capability and others are system capabilities. 1. after deleting the custom capability, when i open mrt editor, validation message shows as "Capability does not exist", Now i do not want to add any capability and continue from here but redmark shows at mrt file so i cannot proceed further. 2. after deleting the custom capability when open dd file and selecting the existing mrt file, none of the remaining capabilities shows in the capabilities section. Build: TPTP-4.4.0-200702160321 In addition to the above comments below is the another comment 1. create new default MRT 2. Create new dd file and select MRT 3. Delete MRT and Try to open DD file error shows up as "unable to create this part due to an internal error Reason for the failure: an unexpected exception was thrown java.lang.NullPointeexception" Build: TPTP-4.4.0-200702160321 Validation message should be shown at the time of removing capability, saying that this capability is being used my an MRT file and related dd file. still if user deletes capability i think redmark should not show on mrt file Created attachment 60463 [details]
Patch for DDE validation if mrt is deleted
Please update target; i1 is already closed patch applied 3/16 Verified - fixed TPTP-4.4.0-200703300100 Verified - fixed TPTP-4.4.0-200703300100 i am reopening this defect because redmark shows up on the mrt file, i think Validation message should be shown at the time of removing capability, saying that this capability is being used by an MRT file and related dd file. still if user deletes capability i think redmark should not show on mrt file Build: TPTP-4.4.0-200704020100 To summarize, There are two ways to go about this, 1. Put the onus on the user to delete the capability from the MRT file that references it. In this case, the red mark should be shown. The reason for doing this is that, user may just be replacing an existing capability file with another. In this case, we don't want to unnecessarily remove the capability and have the user add it again. User should just replace current file (without deleting it first) but let's assume users may delete and replace. 2. Remove the capability from the MRT automtically and show no red mark (of course we'll show a message indicating the same). I am somehow not happy about just deleting things and we could do some complicated like ask the user if we should delete it from the MRT (instead of just informing, the dialog can actually ask a question and take input). #1 seems to be standard Eclipse behavior - if I remove a JAR, classes of which are imported in other source file, the imports just don't go away but are marked as red. Its upto the user to go correct them. All 4.4 defects need to be flagged P1 I think that a popup asking the user if they want to delete the MRT file is the best approach. If they say yes, delete it and do not show a red mark, if they do leave it there and add the red decorator. Verified Build: TPTP-4.4.0-200704250100 marking fixed closing since verified |
1. Create a new default Capability (new_file.cap) 2. Create a new default MRT file and select new_file.cap file in to the default mrt file (new_file.mrt) 3. Create a new default dd file and select new_file,mrt file in to the dd file (my.dd) 4. Remove the new_file.mcap file 5. Now reopen the New_file.mrt file, No system defined capabilities are shown in the editor 6. Now reopen the my.dd file, it throws below exception java.lang.NullPointerException at org.eclipse.tptp.wsdm.tooling.editor.dde.util.internal.LoaderUtil.isExists(LoaderUtil.java:243) at org.eclipse.tptp.wsdm.tooling.editor.dde.util.internal.LoaderUtil.synchronizeMRTandResourceType(LoaderUtil.java:205) at org.eclipse.tptp.wsdm.tooling.editor.dde.util.internal.LoaderUtil.loadResourceTypeTable(LoaderUtil.java:177) at org.eclipse.tptp.wsdm.tooling.editor.dde.util.internal.LoaderUtil.loadModel(LoaderUtil.java:85) at org.eclipse.tptp.wsdm.tooling.editor.dde.internal.DescriptorEditor.createPages(DescriptorEditor.java:1945) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:276) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566) at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:214) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2588) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2521) at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2513) at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2498) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2493) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2478) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:275) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:139) at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:190) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:174) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:306) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:651) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:817) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:843) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:815) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1069) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1168) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:249) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:243) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:283) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)