Minor. Cleanup code

This commit is contained in:
Mikhael Bogdanov
2017-04-13 15:01:37 +02:00
parent 3df32ad425
commit a6c9cf7d3f
5 changed files with 27 additions and 39 deletions
@@ -134,10 +134,10 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight
private void performTest() {
Project project = getProject();
List<KtFile> files = new ArrayList<KtFile>(PluginJetFilesProvider.allFilesInProject(project));
List<KtFile> files = new ArrayList<>(PluginJetFilesProvider.allFilesInProject(project));
if (files.isEmpty()) return;
final List<Breakpoint> breakpoints = Lists.newArrayList();
List<Breakpoint> breakpoints = Lists.newArrayList();
for (KtFile file : files) {
breakpoints.addAll(extractBreakpointsInfo(file, file.getText()));
}
@@ -153,20 +153,17 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight
debugProcess = createDebugProcess(referencesByName);
final PositionManager positionManager = createPositionManager(debugProcess, files, state);
PositionManager positionManager = createPositionManager(debugProcess, files, state);
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
try {
for (Breakpoint breakpoint : breakpoints) {
assertBreakpointIsHandledCorrectly(breakpoint, positionManager);
}
}
catch (NoDataException e) {
throw ExceptionUtilsKt.rethrow(e);
ApplicationManager.getApplication().runReadAction(() -> {
try {
for (Breakpoint breakpoint : breakpoints) {
assertBreakpointIsHandledCorrectly(breakpoint, positionManager);
}
}
catch (NoDataException e) {
throw ExceptionUtilsKt.rethrow(e);
}
});
}
@@ -199,7 +196,7 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight
return new SmartMockReferenceTypeContext(outputFiles).getReferenceTypesByName();
}
private DebugProcessEvents createDebugProcess(final Map<String, ReferenceType> referencesByName) {
private DebugProcessEvents createDebugProcess(Map<String, ReferenceType> referencesByName) {
return new DebugProcessEvents(getProject()) {
private VirtualMachineProxyImpl virtualMachineProxy;
@@ -264,7 +261,7 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight
@Override
public List<ReferenceType> allClasses() {
return new ArrayList<ReferenceType>(referencesByName.values());
return new ArrayList<>(referencesByName.values());
}
@Override