if (input instanceof FileEditorInput) { IFile file= ((FileEditorInput) input).getFile(); ICompilationUnit cu= JavaCore.createCompilationUnitFrom(file); if (cu != null) { return JavaModelUtil.toWorkingCopy(cu);
if (input instanceof IFileEditorInput) { IFile file= ((IFileEditorInput) input).getFile(); IJavaElement element= JavaCore.create(file); if (element instanceof ICompilationUnit) { return JavaModelUtil.toWorkingCopy((ICompilationUnit) element);
	private ICompilationUnit getCompilationUnit(IEditorInput input) {		if (input instanceof FileEditorInput) {			IFile file= ((FileEditorInput) input).getFile();			ICompilationUnit cu= JavaCore.createCompilationUnitFrom(file);			if (cu != null) {				return JavaModelUtil.toWorkingCopy(cu);			}		}		return null;	}