Map compilerOptions= null; if (input instanceof IResourceProvider) { IResource resource= ((IResourceProvider) input).getResource(); if (resource != null) { IJavaElement element= JavaCore.create(resource); if (element != null) { IJavaProject javaProject= element.getJavaProject(); if (javaProject != null) compilerOptions= javaProject.getOptions(true); } } } if (compilerOptions == null) compilerOptions= fDefaultCompilerOptions;  if (doc != null) { boolean isEditable= false; if (input instanceof IEditableContent) isEditable= ((IEditableContent) input).isEditable();   JavaNode root= new JavaNode(doc, isEditable) { void nodeChanged(JavaNode node) { save(this, input); } };  if (buffer == null) { contents= doc.get(); int n= contents.length(); buffer= new char[n]; contents.getChars(0, n, buffer, 0); }  ASTParser parser= ASTParser.newParser(AST.JLS3); if (compilerOptions != null) parser.setCompilerOptions(compilerOptions); parser.setSource(buffer); parser.setFocalPosition(0); CompilationUnit cu= (CompilationUnit) parser.createAST(null); cu.accept(new JavaParseTreeBuilder(root, buffer, true));  return root; } return null;
return createStructureComparator(input, buffer, doc, null);
	public IStructureComparator getStructure(final Object input) {		String contents= null;		char[] buffer= null;		IDocument doc= CompareUI.getDocument(input);		if (doc == null) {			if (input instanceof IStreamContentAccessor) {				IStreamContentAccessor sca= (IStreamContentAccessor) input;							try {					contents= JavaCompareUtilities.readString(sca);				} catch (CoreException ex) {					// return null indicates the error.					return null;				}						}						if (contents != null) {				int n= contents.length();				buffer= new char[n];				contents.getChars(0, n, buffer, 0);								doc= new Document(contents);				//CompareUI.registerDocument(input, doc);				JavaCompareUtilities.setupDocument(doc);							}		}				Map compilerOptions= null;		if (input instanceof IResourceProvider) {			IResource resource= ((IResourceProvider) input).getResource();			if (resource != null) {				IJavaElement element= JavaCore.create(resource);				if (element != null) {					IJavaProject javaProject= element.getJavaProject();					if (javaProject != null)						compilerOptions= javaProject.getOptions(true);				}			}		}		if (compilerOptions == null)			compilerOptions= fDefaultCompilerOptions;				if (doc != null) {			boolean isEditable= false;			if (input instanceof IEditableContent)				isEditable= ((IEditableContent) input).isEditable();						// we hook into the root node to intercept all node changes			JavaNode root= new JavaNode(doc, isEditable) {				void nodeChanged(JavaNode node) {					save(this, input);				}			};						if (buffer == null) {				contents= doc.get();				int n= contents.length();				buffer= new char[n];				contents.getChars(0, n, buffer, 0);			}									ASTParser parser= ASTParser.newParser(AST.JLS3);			if (compilerOptions != null)				parser.setCompilerOptions(compilerOptions);			parser.setSource(buffer);			parser.setFocalPosition(0);			CompilationUnit cu= (CompilationUnit) parser.createAST(null);			cu.accept(new JavaParseTreeBuilder(root, buffer, true));						return root;		}		return null;	}