mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
useless throws removed
This commit is contained in:
+10
-16
@@ -40,7 +40,6 @@ import com.intellij.testFramework.PsiTestUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -58,24 +57,19 @@ public class FindClassTest extends PsiTestCase {
|
||||
|
||||
final File root = createTempDirectory();
|
||||
WriteCommandAction.runWriteCommandAction(null, () -> {
|
||||
try {
|
||||
VirtualFile rootVFile =
|
||||
LocalFileSystem.getInstance().refreshAndFindFileByPath(root.getAbsolutePath().replace(File.separatorChar, '/'));
|
||||
VirtualFile rootVFile =
|
||||
LocalFileSystem.getInstance().refreshAndFindFileByPath(root.getAbsolutePath().replace(File.separatorChar, '/'));
|
||||
|
||||
myPrjDir1 = createChildDirectory(rootVFile, "prj1");
|
||||
mySrcDir1 = createChildDirectory(myPrjDir1, "src1");
|
||||
myPrjDir1 = createChildDirectory(rootVFile, "prj1");
|
||||
mySrcDir1 = createChildDirectory(myPrjDir1, "src1");
|
||||
|
||||
myPackDir = createChildDirectory(mySrcDir1, "p");
|
||||
VirtualFile file1 = createChildData(myPackDir, "A.java");
|
||||
setFileText(file1, "package p; public class A{ public void foo(); }");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
myPackDir = createChildDirectory(mySrcDir1, "p");
|
||||
VirtualFile file1 = createChildData(myPackDir, "A.java");
|
||||
setFileText(file1, "package p; public class A{ public void foo(); }");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
|
||||
PsiTestUtil.addContentRoot(myModule, myPrjDir1);
|
||||
PsiTestUtil.addSourceRoot(myModule, mySrcDir1);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
PsiTestUtil.addContentRoot(myModule, myPrjDir1);
|
||||
PsiTestUtil.addSourceRoot(myModule, mySrcDir1);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-16
@@ -27,7 +27,6 @@ import com.intellij.testFramework.PsiTestCase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
@@ -43,24 +42,19 @@ public class SameSourceRootInTwoModulesTest extends PsiTestCase {
|
||||
|
||||
final File root = createTempDirectory();
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
try {
|
||||
VirtualFile rootVFile =
|
||||
LocalFileSystem.getInstance().refreshAndFindFileByPath(root.getAbsolutePath().replace(File.separatorChar, '/'));
|
||||
VirtualFile rootVFile =
|
||||
LocalFileSystem.getInstance().refreshAndFindFileByPath(root.getAbsolutePath().replace(File.separatorChar, '/'));
|
||||
|
||||
myPrjDir1 = createChildDirectory(rootVFile, "prj1");
|
||||
mySrcDir1 = createChildDirectory(myPrjDir1, "src1");
|
||||
myPrjDir1 = createChildDirectory(rootVFile, "prj1");
|
||||
mySrcDir1 = createChildDirectory(myPrjDir1, "src1");
|
||||
|
||||
myPackDir = createChildDirectory(mySrcDir1, "p");
|
||||
VirtualFile file1 = createChildData(myPackDir, "A.java");
|
||||
setFileText(file1, "package p; public class A{ public void foo(); }");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
myPackDir = createChildDirectory(mySrcDir1, "p");
|
||||
VirtualFile file1 = createChildData(myPackDir, "A.java");
|
||||
setFileText(file1, "package p; public class A{ public void foo(); }");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
|
||||
PsiTestUtil.addContentRoot(myModule, myPrjDir1);
|
||||
PsiTestUtil.addSourceRoot(myModule, mySrcDir1);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
PsiTestUtil.addContentRoot(myModule, myPrjDir1);
|
||||
PsiTestUtil.addSourceRoot(myModule, mySrcDir1);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -438,14 +438,18 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
protected void tearDown() throws Exception {
|
||||
Project project = myProject;
|
||||
|
||||
runTearDownActions(project);
|
||||
}
|
||||
|
||||
private void runTearDownActions(Project project) {
|
||||
new RunAll()
|
||||
.append(() -> {
|
||||
if (project != null) {
|
||||
LightPlatformTestCase.doTearDown(project, ourApplication, false);
|
||||
}
|
||||
})
|
||||
.append(() -> disposeProject())
|
||||
.append(() -> checkForSettingsDamage())
|
||||
.append(this::disposeProject)
|
||||
.append(this::checkForSettingsDamage)
|
||||
.append(() -> {
|
||||
if (project != null) {
|
||||
InjectedLanguageManagerImpl.checkInjectorsAreDisposed(project);
|
||||
@@ -475,7 +479,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
myThreadTracker.checkLeak();
|
||||
}
|
||||
})
|
||||
.append(() -> LightPlatformTestCase.checkEditorsReleased())
|
||||
.append(LightPlatformTestCase::checkEditorsReleased)
|
||||
.append(() -> {
|
||||
myProjectManager = null;
|
||||
myProject = null;
|
||||
@@ -871,7 +875,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
}.execute().throwException();
|
||||
}
|
||||
|
||||
public static void setFileText(@NotNull final VirtualFile file, @NotNull final String text) throws IOException {
|
||||
public static void setFileText(@NotNull final VirtualFile file, @NotNull final String text) {
|
||||
new WriteAction() {
|
||||
@Override
|
||||
protected void run(@NotNull Result result) throws Throwable {
|
||||
|
||||
Reference in New Issue
Block a user