Project: Birt
Bug 233157 [regression]NPE when drag level in xtab from one area to another[1102]
Reported: 2008-05-21 03:53:38 | Status: closed fixed

Description: NPE when drag level in xtab from one area to another Build number:2.3.0.v2008051 Steps to reproduce: 1. New sample data source and dataset from CUSTOMERS. 2. New cube with two group based on CUSTOMERS. 3. Drag the cube to layout. 4. Drag one level to column area. Expected result: No Exception. Actual result: Level is placed in column area but throws NPE Error log: java.lang.NullPointerException at org.eclipse.birt.report.designer.util.DEUtil.isLinkedElement(DEUtil.java:2526) at org.eclipse.birt.report.designer.util.DEUtil.isReferenceElement(DEUtil.java:2906) at org.eclipse.birt.report.item.crosstab.internal.ui.AggregationDropAdapter.canDrop(AggregationDropAdapter.java:45) at org.eclipse.birt.report.designer.internal.ui.dnd.DNDService.validDrop(DNDService.java:128) at org.eclipse.birt.report.designer.ui.actions.InsertAggregationAction.calculateEnabled(InsertAggregationAction.java:53) at org.eclipse.gef.ui.actions.WorkbenchPartAction.refresh(WorkbenchPartAction.java:119) at org.eclipse.gef.ui.actions.SelectionAction.handleSelectionChanged(SelectionAction.java:85) at org.eclipse.gef.ui.actions.SelectionAction.setSelection(SelectionAction.java:96) at org.eclipse.gef.ui.actions.SelectionAction.update(SelectionAction.java:117) at org.eclipse.birt.report.designer.internal.ui.editors.parts.GraphicalEditorWithFlyoutPalette.updateActions(GraphicalEditorWithFlyoutPalette.java:697) at org.eclipse.birt.report.designer.internal.ui.editors.parts.GraphicalEditorWithFlyoutPalette$1.selectionChanged(GraphicalEditorWithFlyoutPalette.java:140) at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156) at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62) at org.eclipse.ui.part.MultiPageSelectionProvider$1.run(MultiPageSelectionProvider.java:110) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.part.MultiPageSelectionProvider.fireEventChange(MultiPageSelectionProvider.java:108) at org.eclipse.ui.part.MultiPageSelectionProvider.fireSelectionChanged(MultiPageSelectionProvider.java:90) at org.eclipse.ui.part.MultiPageEditorSite.handleSelectionChanged(MultiPageEditorSite.java:441) at org.eclipse.ui.part.MultiPageEditorSite$3.selectionChanged(MultiPageEditorSite.java:357) at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:243) at org.eclipse.birt.report.designer.internal.ui.editors.parts.DeferredGraphicalViewer.fireSelectionChanged(DeferredGraphicalViewer.java:317) 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:1063) 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:862) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3759) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3384) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.jface.dialogs.MessageDialogWithToggle.openYesNoQuestion(MessageDialogWithToggle.java:306) at org.eclipse.birt.report.item.crosstab.internal.ui.editors.model.CrosstabAdaptUtil.processInvaildBindings(CrosstabAdaptUtil.java:358) at org.eclipse.birt.report.item.crosstab.internal.ui.editors.commands.ChangeAreaCommand.execute(ChangeAreaCommand.java:79) at org.eclipse.gef.commands.CompoundCommand.execute(CompoundCommand.java:107) at org.eclipse.birt.report.designer.internal.ui.command.WrapperCommandStack.execute(WrapperCommandStack.java:92) at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:399) at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:411) at org.eclipse.gef.tools.DragEditPartsTracker.performDrag(DragEditPartsTracker.java:469) at org.eclipse.gef.tools.DragEditPartsTracker.handleButtonUp(DragEditPartsTracker.java:333) at org.eclipse.birt.report.item.crosstab.internal.ui.editors.editparts.CrosstabFirstCellEditPart$ControlFigure$1.handleButtonUp(CrosstabFirstCellEditPart.java:142) at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1064) at org.eclipse.gef.tools.SelectionTool.mouseUp(SelectionTool.java:544) at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:259) at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374) at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:538) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:206) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3782) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3381) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2394) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2358) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2210) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:494) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:489) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:112) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

Files changed in fix:
UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/DEUtil.java