Bug 153382 [Smoke][Regression]NPE when creating a template report item within a list
Steps to reproduce: 1.New a list, add a data in the list detail 2.Choose the data, create a template report item Expected result: The data is converted to a template report item Actual result: org.eclipse.birt.report.designer.core.runtime.GUIException: Caused by java.lang.NullPointerException. at org.eclipse.birt.report.designer.core.runtime.GUIException.createGUIException(GUIException.java:76) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:123) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:105) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:131) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postEvent(ModelEventManager.java:101) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.access$000(ModelEventManager.java:35) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager$1.stackChanged(ModelEventManager.java:61) at org.eclipse.birt.report.model.activity.ActivityStack.sendNotifcations(ActivityStack.java:845) at org.eclipse.birt.report.model.activity.ActivityStack.commit(ActivityStack.java:719) at org.eclipse.birt.report.designer.internal.ui.views.actions.AbstractElementAction.run(AbstractElementAction.java:71) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.actions.WrapperSelectionAction.run(WrapperSelectionAction.java:61) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) 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:324) 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) Caused by: java.lang.NullPointerException at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ListEditPart.contentChange(ListEditPart.java:281) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart.contentChange(AbstractReportEditPart.java:203) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart$1.runModelChange(AbstractReportEditPart.java:67) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart$EditpartReportEventRunnable.run(AbstractReportEditPart.java:235) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractModelEventProcessor.postElementEvent(AbstractModelEventProcessor.java:95) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:126) ... 33 more
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/editparts/ListEditPart.java
if (getModelAdapter( ).isChildren((DesignElementHandle )model))
			{
				return true;
			}
		}
		return super.isinterest( model ) ;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportElementEditPart#contentChange(java.util.Map)
	 */
	protected void contentChange( Map info )
	{
		int intValue = ((Integer)info.get(GraphicsViewModelEventProcessor.CONTENT_EVENTTYPE )).intValue( );
		if (intValue == ContentEvent.REMOVE)
		{
			List list = (List)info.get( GraphicsViewModelEventProcessor.EVENT_CONTENTS );
			int size = list.size( );
			for (int i=0;i<size; i++)
			{
				Object obj = list.get( i );
				if (obj instanceof DesignElementHandle)
				{
					getListHandleAdapt( ).remove( obj );
				}
			}
		}
		super.contentChange( info );
	}
}