<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . resources . IResourceStatus ; import org . eclipse . core . resources . IWorkspaceRunnable ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . JavaModelException ; public class BatchOperation extends JavaModelOperation { protected IWorkspaceRunnable runnable ; public BatchOperation ( IWorkspaceRunnable runnable ) { this . runnable = runnable ; } protected boolean canModifyRoots ( ) { return true ; } protected void executeOperation ( ) throws JavaModelException { try { this . runnable . run ( this . progressMonitor ) ; } catch ( CoreException ce ) { if ( ce instanceof JavaModelException ) { throw ( JavaModelException ) ce ; } else { if ( ce . getStatus ( ) . getCode ( ) == IResourceStatus . OPERATION_FAILED ) { Throwable e = ce . getStatus ( ) . getException ( ) ; if ( e instanceof JavaModelException ) { throw ( JavaModelException ) e ; } } throw new JavaModelException ( ce ) ; } } } protected IJavaModelStatus verify ( ) { return JavaModelStatus . VERIFIED_OK ; } } </s>