<s> package org . eclipse . jdt . core . compiler ; import java . util . HashMap ; import org . eclipse . jdt . core . ICompilationUnit ; import org . eclipse . jdt . core . IJavaElementDelta ; import org . eclipse . jdt . core . IJavaModelMarker ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . dom . AST ; import org . eclipse . jdt . core . dom . ASTParser ; import org . eclipse . jdt . internal . core . CompilationUnit ; import org . eclipse . jdt . internal . core . JavaProject ; import org . eclipse . jdt . internal . core . ReconcileWorkingCopyOperation ; public class ReconcileContext { private ReconcileWorkingCopyOperation operation ; private CompilationUnit workingCopy ; public ReconcileContext ( ReconcileWorkingCopyOperation operation , CompilationUnit workingCopy ) { this . operation = operation ; this . workingCopy = workingCopy ; } public org . eclipse . jdt . core . dom . CompilationUnit getAST3 ( ) throws JavaModelException { if ( this . operation . astLevel != AST . JLS3 || ! this . operation . resolveBindings ) { ASTParser parser = ASTParser . newParser ( AST . JLS3 ) ; parser . setCompilerOptions ( this . workingCopy . getJavaProject ( ) . getOptions ( true ) ) ; if ( JavaProject . hasJavaNature ( this . workingCopy . getJavaProject ( ) . getProject ( ) ) ) parser . setResolveBindings ( true ) ; parser . setStatementsRecovery ( ( this . operation . reconcileFlags & ICompilationUnit . ENABLE_STATEMENTS_RECOVERY ) != 0 ) ; parser . setBindingsRecovery ( ( this . operation . reconcileFlags & ICompilationUnit . ENABLE_BINDINGS_RECOVERY ) != 0 ) ; parser . setSource ( this . workingCopy ) ; parser . setIgnoreMethodBodies ( ( this . operation . reconcileFlags & ICompilationUnit . IGNORE_METHOD_BODIES ) != 0 ) ; return ( org . eclipse . jdt . core . dom . CompilationUnit ) parser . createAST ( this . operation . progressMonitor ) ; } return this . operation . makeConsistent ( this . workingCopy ) ; } public int getASTLevel ( ) { return this . operation . astLevel ; } public boolean isResolvingBindings ( ) { return this . operation . resolveBindings ; } public int getReconcileFlags ( ) { return this . operation . reconcileFlags ; } public IJavaElementDelta getDelta ( ) { return this . operation . deltaBuilder . delta ; } public CategorizedProblem [ ] getProblems ( String markerType ) { if ( this . operation . problems == null ) return null ; return ( CategorizedProblem [ ] ) this . operation . problems . get ( markerType ) ; } public ICompilationUnit getWorkingCopy ( ) { return this . workingCopy ; } public void resetAST ( ) { this . operation . ast = null ; putProblems ( IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER , null ) ; putProblems ( IJavaModelMarker . TASK_MARKER , null ) ; } public void putProblems ( String markerType , CategorizedProblem [ ] problems ) { if ( this . operation . problems == null ) this . operation . problems = new HashMap ( ) ; this . operation . problems . put ( markerType , problems ) ; } } </s>