PsiElement (PsiElement element) { if (element.getLanguage() == JAVA) { int hopes = 0; while (hopes++ < MAX_HOPES && element != null) { if (element instanceof PsiField || element instanceof PsiClassInitializer || element instanceof PsiMethod || element instanceof ImportStatementElement || element instanceof PsiClass ) return element; element = element.getParent(); } } return null; }