PsiFile (@NotNull PsiClass aClass) { PsiFile file = aClass.getContainingFile(); if (file == null) { PsiUtilCore.ensureValid(aClass); throw new IllegalStateException("No containing file for " + aClass.getLanguage() + " " + aClass.getClass()); } return file.getOriginalFile(); }