Java 类com.intellij.util.lang.CompoundRuntimeException 实例源码

项目:intellij-ce-playground    文件:LightIdeaTestFixtureImpl.java   
@Override
public void tearDown() throws Exception {
  Project project = getProject();
  CodeStyleSettingsManager.getInstance(project).dropTemporarySettings();
  CodeStyleSettings oldCodeStyleSettings = myOldCodeStyleSettings;
  myOldCodeStyleSettings = null;
  List<Throwable> exceptions = new SmartList<Throwable>();
  try {
    UsefulTestCase.doCheckForSettingsDamage(oldCodeStyleSettings, getCurrentCodeStyleSettings(), exceptions);

    LightPlatformTestCase.doTearDown(project, LightPlatformTestCase.getApplication(), true, exceptions);
    super.tearDown();
    InjectedLanguageManagerImpl.checkInjectorsAreDisposed(project);
    PersistentFS.getInstance().clearIdCache();
    PlatformTestCase.cleanupApplicationCaches(project);
  }
  finally {
    CompoundRuntimeException.throwIfNotEmpty(exceptions);
  }
}
项目:intellij-ce-playground    文件:ModuleTestCase.java   
@Override
protected void tearDown() throws Exception {
  try {
    ModuleManager moduleManager = ModuleManager.getInstance(myProject);
    List<Throwable> errors = null;
    AccessToken token = WriteAction.start();
    try {
      for (Module module : myModulesToDispose) {
        try {
          String moduleName = module.getName();
          if (moduleManager.findModuleByName(moduleName) != null) {
            moduleManager.disposeModule(module);
          }
        }
        catch (Throwable e) {
          if (errors == null) {
            errors = new SmartList<Throwable>();
          }
          errors.add(e);
        }
      }
    }
    finally {
      token.finish();
    }

    CompoundRuntimeException.throwIfNotEmpty(errors);
  }
  finally {
    myModulesToDispose.clear();
    super.tearDown();
  }
}
项目:consulo    文件:ModuleTestCase.java   
@Override
protected void tearDown() throws Exception {
  try {
    if (!myModulesToDispose.isEmpty()) {
      List<Throwable> errors = new SmartList<>();
      WriteAction.run(() -> {
        ModuleManager moduleManager = ModuleManager.getInstance(myProject);
        for (Module module : myModulesToDispose) {
          try {
            String moduleName = module.getName();
            if (moduleManager.findModuleByName(moduleName) != null) {
              moduleManager.disposeModule(module);
            }
          }
          catch (Throwable e) {
            errors.add(e);
          }
        }
      });
      CompoundRuntimeException.throwIfNotEmpty(errors);
    }
  }
  finally {
    myModulesToDispose.clear();
    super.tearDown();
  }
}
项目:consulo    文件:MessageBusImpl.java   
private static void rethrowExceptions(List<Throwable> exceptions) {
  if (exceptions == null) return;

  ProcessCanceledException pce = ContainerUtil.findInstance(exceptions, ProcessCanceledException.class);
  if (pce != null) throw pce;

  CompoundRuntimeException.throwIfNotEmpty(exceptions);
}
项目:consulo-java    文件:ModuleTestCase.java   
@Override
protected void tearDown() throws Exception
{
    try
    {
        if(!myModulesToDispose.isEmpty())
        {
            List<Throwable> errors = new SmartList<>();
            WriteAction.run(() ->
            {
                ModuleManager moduleManager = ModuleManager.getInstance(myProject);
                for(Module module : myModulesToDispose)
                {
                    try
                    {
                        String moduleName = module.getName();
                        if(moduleManager.findModuleByName(moduleName) != null)
                        {
                            moduleManager.disposeModule(module);
                        }
                    }
                    catch(Throwable e)
                    {
                        errors.add(e);
                    }
                }
            });
            CompoundRuntimeException.throwIfNotEmpty(errors);
        }
    }
    finally
    {
        myModulesToDispose.clear();
        super.tearDown();
    }
}
项目:intellij-ce-playground    文件:ExecutionWithDebuggerToolsTestCase.java   
protected void throwExceptionsIfAny() {
  synchronized (myException) {
    CompoundRuntimeException.throwIfNotEmpty(myException);
  }
}
项目:intellij-ce-playground    文件:PlatformTestCase.java   
public static void closeAndDisposeProjectAndCheckThatNoOpenProjects(@NotNull Project projectToClose) {
  List<Throwable> exceptions = new SmartList<Throwable>();
  closeAndDisposeProjectAndCheckThatNoOpenProjects(projectToClose, exceptions);
  CompoundRuntimeException.throwIfNotEmpty(exceptions);
}