コード例 #1
0
 private PsiClass createArrayClass(String text, LanguageLevel level) {
   PsiClass psiClass =
       ((PsiExtensibleClass) createClassFromText(text, null)).getOwnInnerClasses().get(0);
   ensureNonWritable(psiClass);
   PsiFile file = psiClass.getContainingFile();
   ((PsiJavaFileBaseImpl) file).clearCaches();
   PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(file, level);
   return psiClass;
 }
コード例 #2
0
 private static void ensureNonWritable(PsiClass arrayClass) {
   try {
     arrayClass.getContainingFile().getViewProvider().getVirtualFile().setWritable(false);
   } catch (IOException ignored) {
   }
 }