Bug 157135 Use source from library error in a special condition
Description: Set the preferences->Report Design->Resource Fold as its default value(blank).Drag a something from library to a report which is in a subfold of a project.It will get an error. Step to reproduce: 1. go to preferences->Report Design->Resource, in that page click the "Restore Defaults" 2. New a report project 3. New a fold in the new project(a yellow fold) 4. New a library in the project and new a datasource in the library 5. New a report "New_report1.rptdesign" under the project fold(the blue one) 6. New another report "New_report2.rptdesign" under the subfold of the project (the yellow fold) 7. Drag the datasource frow the new library to this two report. Actual result: drag to the New_report1.rptdesign is ok, but to the "New_report2.rptdesign" will get an error Error log: Error.DesignFileException.SYNTAX_ERROR - 1 errors found! 1.) org.eclipse.birt.report.model.parser.DesignParserException (code = Error.DesignParserException.FILE_NOT_FOUND, message : The file "new_library_4.rptlibrary" is not found.) at org.eclipse.birt.report.model.core.Module.loadLibrary(Module.java:1528) at org.eclipse.birt.report.model.command.LibraryCommand.doAddLibrary(LibraryCommand.java:465) at org.eclipse.birt.report.model.command.LibraryCommand.addLibrary(LibraryCommand.java:122) at org.eclipse.birt.report.model.api.ModuleHandle.includeLibrary(ModuleHandle.java:1936) at org.eclipse.birt.report.designer.internal.ui.util.UIUtil.includeLibrary(UIUtil.java:1099) at org.eclipse.birt.report.designer.internal.ui.util.UIUtil.includeLibrary(UIUtil.java:1151) at org.eclipse.birt.report.designer.internal.ui.views.outline.dnd.DesignerDropListener.copyData(DesignerDropListener.java:223) at org.eclipse.birt.report.designer.internal.ui.dnd.DesignElementDropAdapter.performDrop(DesignElementDropAdapter.java:102) at org.eclipse.birt.report.designer.internal.ui.views.outline.dnd.DesignerDropListener.performDrop(DesignerDropListener.java:139) at org.eclipse.jface.viewers.ViewerDropAdapter.drop(ViewerDropAdapter.java:233) at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:65) 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.Widget.notifyListeners(Widget.java:709) at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:423) at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:238) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117) at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method) at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:306) at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:277) at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:164) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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) Expected result: it can work normal.
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/DefaultResourceLocator.java
* The default file search algorithm. It searches for a given file in the 'base'
 * folder of a design. If the 'base' property of the design was not set, then
 * this class looks in folder where the design file is located.
 * <p>
 * The detail search mechanism is:
 * <ul>
 * <li>If the the file to be found is given by an absolute path, returns that
 * path.
 * <li>If it is a relative file path, search the 'base' folder of the design.
 * <li>If the 'base' property of the design is not set, then search the file in
 * the folder where the design file locates.
 * </ul>
 * 
 * @see IResourceLocator
 * @see SessionHandle
 */
public class DefaultResourceLocator implements IResourceLocator
{
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.model.api.IResourceLocator#findResource(org.eclipse.birt.report.model.api.ModuleHandle,
	 *      java.lang.String, int)
	 */
	public URL findResource( ModuleHandle moduleHandle, String fileName,
			int type )
	{
		URL u = null;
		if ( fileName == null )
			return u;