IJavaElement element= JavaCore.create(resource); if (! (element instanceof ICompilationUnit)) continue;
	public static SearchResultGroup[] excludeCompilationUnits(SearchResultGroup[] grouped, IFile[] unsavedFiles, RefactoringStatus status) throws JavaModelException{		List result= new ArrayList();		List unsavedFileList= Arrays.asList(unsavedFiles);		boolean wasEmpty= grouped.length == 0;		for (int i= 0; i < grouped.length; i++){				IResource resource= grouped[i].getResource();			if (unsavedFileList.contains(resource)){				status.addError(RefactoringCoreMessages.getFormattedString("Checks.not_saved", resource.getFullPath().toString())); //$NON-NLS-1$				continue; //removed, go to the next one			}			ICompilationUnit cu= (ICompilationUnit)JavaCore.create(resource);			if (! cu.isStructureKnown()){				String path= AbstractRefactoringASTAnalyzer.getFullPath(cu);				status.addError(RefactoringCoreMessages.getFormattedString("Checks.cannot_be_parsed", path)); //$NON-NLS-1$				continue; //removed, go to the next one			}			result.add(grouped[i]);			}				if ((!wasEmpty) && result.isEmpty())			status.addFatalError(RefactoringCoreMessages.getString("Checks.all_excluded")); //$NON-NLS-1$				return (SearchResultGroup[])result.toArray(new SearchResultGroup[result.size()]);	}