/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.engine.plugin;

import org.eclipse.birt.report.engine.api.ReportRunner;
import org.eclipse.core.runtime.IPlatformRunnable;

public class ReportExecutor implements IPlatformRunnable
{

	public Object run( Object args ) throws Exception
	{
		if ( args instanceof String[] )
		{
			new ReportRunner( (String[]) args ).execute( );
		}
		return null;
	}
}

@@ -800,77 +800,614 @@
 %7B%0A%09%09
-if ( args instanceof String%5B%5D )%0A%09%09%7B%0A%09%09%09new ReportRunner( (String%5B%5D) a
+// as we know that the last argument must be a report design%0A%09%09// or report document, so remove any extra arguments which%0A%09%09// added by the eclipse platform (which is started with '-').%0A%09%09if ( args instanceof String%5B%5D )%0A%09%09%7B%0A%09%09%09String%5B%5D platformArgs = (String%5B%5D) args;%0A%09%09%09int appArgLength = platformArgs.length;%0A%09%09%09for ( ; appArgLength %3E 0; appArgLength-- )%0A%09%09%09%7B%0A%09%09%09%09String arg = platformArgs%5BappArgLength - 1%5D;%0A%09%09%09%09if ( arg.charAt( 0 ) != '-' )%0A%09%09%09%09%7B%0A%09%09%09%09%09break;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%09String%5B%5D appArgs = new String%5BappArgLength%5D;%0A%09%09%09System.arraycopy( args, 0, appArgs, 0, appArgLength );%0A%09%09%09new ReportRunner( appA
 rgs 

remove extra arguments added by the eclipse platform