Bug 147013 Add a nonexistent library
Details: Add a nonexistent library to nonexistent folder Step: 1.Open Library explorer 2.Right click and select Add library. 3.Insert abc.rptlibrary that is nonexistent in source file. 4.Insert abc.rptlibrary in file name. 5.Click Finish and it pop up the dialog said that the library is nonexistent. 6.Refresh and Deploy the library. Actual result: Pop up an NullpointerException java.lang.NullPointerException at org.eclipse.birt.report.model.parser.ModuleParserErrorHandler.semanticError(ModuleParserErrorHandler.java:31) at org.eclipse.birt.report.model.util.XMLParserHandler.fatalError(XMLParserHandler.java:279) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:218) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:230) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:89) at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:171) at org.eclipse.birt.report.model.parser.LibraryReader.read(LibraryReader.java:170) at org.eclipse.birt.report.model.core.DesignSession.openLibrary(DesignSession.java:346) at org.eclipse.birt.report.model.api.SessionHandle.openLibrary(SessionHandle.java:235) at org.eclipse.birt.report.designer.ui.lib.explorer.LibraryExplorerProvider.getChildren(LibraryExplorerProvider.java:89) at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:1157) at org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeViewer.java:768) at org.eclipse.jface.viewers.AbstractTreeViewer.getFilteredChildren(AbstractTreeViewer.java:565) at org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildren(AbstractTreeViewer.java:534) at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:719) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:696) at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:892) at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1240) at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:1252) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:181) 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.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937) at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:6254) at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:3794) at org.eclipse.swt.widgets.Composite.WM_NOTIFY(Composite.java:1166) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3298) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1842) at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1319) at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:5171) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3279) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:4768) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1923) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) 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)
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/wizards/WizardLibrarySettingPage.java
{
			folderText.setText( folder );
		}	
		folderText.addModifyListener( new ModifyListener( ) {
			public void modifyText( ModifyEvent e )
			{
				checkStatus( type );
			}
		} );
		Button chooseBtn = new Button( container, SWT.NONE );
		chooseBtn.setText( BUTTON_BROWSE );
		chooseBtn.addSelectionListener( new SelectionListener( ) {
			public void widgetSelected( SelectionEvent e )
			{
				ResourceFileLabelProvider labelProvider = new ResourceFileLabelProvider( );
				ResourceFileContentProvider contentProvider = new ResourceFileContentProvider(false );
				ResourceFileFolderSelectionDialog dialog = new ResourceFileFolderSelectionDialog(
						UIUtil.getDefaultShell(),labelProvider,contentProvider);				
			
				dialog.setAllowMultiple( false );
				dialog.setTitle( Messages.getString( "WizardLibrarySettingPage.Resourcefile.Dialog.Title" ) ); 
				dialog.setMessage( Messages.getString( "WizardLibrarySettingPage.Resourcefile.Dialog.Message" ) ); 
				dialog.setValidator( new Validator( ) );
				
				dialog.setInput(ReportPlugin.getDefault( ).getResourcePreference( ));
				if(dialog.open( ) == dialog.OK)
				{
					Object[] selected = dialog.getResult( );
					if ( selected.length > 0 )
					{