PsiClass (LanguageLevel level) { String text = level.isAtLeast(LanguageLevel.JDK_1_5) ? "public static class __Array__<T> {\n public final int length;\n public T[] clone() {}\n}" : "public static class __Array__{\n public final int length;\n public Object clone() {}\n}"; PsiClass psiClass = ((PsiExtensibleClass)createClassFromText(text, null)).getOwnInnerClasses().get(0); ensureNonWritable(psiClass); PsiFile file = psiClass.getContainingFile(); file.clearCaches(); PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(file, level); ARRAY_CLASS.set(psiClass, true); return psiClass; }