Project: Birt
Bug 223165 Problem when switch from file to file.
Reported: 2008-03-19 04:14:06 | Status: closed fixed

description: Problem when switch from file to file. build version: 2.3.0 v20080319-0800 steps to reproduce: 1. New two reports. 2. Insert a label in the first report. 3. Switch to the second report and switch to the script page. 4. Switch back to the first report. 5. Select the label and switch to script page. Expected result: after step4, no error. after step5, the script page should show script method avaible for the label. Actual result: after step4, error occurs in error log. See error log for details. after step5, the script page shows This element has no methods. Errorlog: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:3716) at org.eclipse.swt.SWT.error(SWT.java:3634) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3737) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3374) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2392) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2356) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2222) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:474) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:469) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:564) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1251) Caused by: java.lang.NullPointerException at org.eclipse.birt.report.designer.internal.ui.util.UIUtil.containElement(UIUtil.java:879) at org.eclipse.birt.report.designer.internal.ui.views.data.DataViewPage.canSetSelection(DataViewPage.java:318) at org.eclipse.birt.report.designer.internal.ui.views.data.DataViewPage.handleSelectionChange(DataViewPage.java:305) at org.eclipse.birt.report.designer.internal.ui.views.data.DataViewPage.performRequest(DataViewPage.java:277) at org.eclipse.birt.report.designer.core.util.mediator.ReportMediator.notifyRequest(ReportMediator.java:125) at org.eclipse.birt.report.designer.internal.ui.editors.parts.DeferredGraphicalViewer.fireSelectionChanged(DeferredGraphicalViewer.java:315) at org.eclipse.birt.report.designer.internal.ui.editors.parts.DeferredGraphicalViewer.setSelection(DeferredGraphicalViewer.java:122) at org.eclipse.birt.report.designer.internal.ui.util.UIUtil.resetViewSelection(UIUtil.java:1048) at org.eclipse.birt.report.designer.ui.editors.pages.ReportLayoutEditorFormPage.onBroughtToTop(ReportLayoutEditorFormPage.java:287) at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor$1.run(MultiPageReportEditor.java:855) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:130) ... 22 more

Files changed in fix:
UI/org.eclipse.birt.report.designer.ui.editors/src/org/eclipse/birt/report/designer/internal/ui/views/data/DataViewTreeViewerPage.java UI/org.eclipse.birt.report.designer.ui.views/src/org/eclipse/birt/report/designer/internal/ui/views/data/DataViewPage.java