final IType[][] res= new IType[1][];  IRunnableWithProgress runnable= new IRunnableWithProgress() { public void run(IProgressMonitor pm) throws InvocationTargetException { try { res[0]= searchMainMethods(pm, scope, style); } catch (CoreException e) { throw new InvocationTargetException(e); } } }; context.run(true, true, runnable);  return res[0];
SearchPattern pattern= SearchPattern.createPattern("main(String[]) void", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE); SearchRequestor requestor= new MethodCollector(typesFound, style); new SearchEngine().search(pattern, SearchUtils.getDefaultSearchParticipants(), scope, requestor, pm);  return (IType[]) typesFound.toArray(new IType[typesFound.size()]);
	public IType[] searchMainMethods(IRunnableContext context, final IJavaSearchScope scope, final int style) throws InvocationTargetException, InterruptedException  {		int allFlags=  IJavaElementSearchConstants.CONSIDER_EXTERNAL_JARS | IJavaElementSearchConstants.CONSIDER_BINARIES;		Assert.isTrue((style | allFlags) == allFlags);				final IType[][] res= new IType[1][];				IRunnableWithProgress runnable= new IRunnableWithProgress() {			public void run(IProgressMonitor pm) throws InvocationTargetException {				try {					res[0]= searchMainMethods(pm, scope, style);				} catch (CoreException e) {					throw new InvocationTargetException(e);				}			}		};		context.run(true, true, runnable);				return res[0];	}